Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grouping problem
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01338206
Message ID:
01340415
Views:
9
>After doing quite a bit of testing, I don't think the problem is 1 or 2 passes, it is commands that generate errors.
>
>The code to print the report to file is pretty simple. The code that does the SPT queries and creates the group codes is lengthy and complex but it works fine and there are no issues unless I try to print to file. Here's that code:
>
>
>CREATE CURSOR PgCnt (caseno C(9),PageCnt INT(4))       && accumulates page count by grouping
>SELECT Groups                                          && drives the report

>REPORT FORM CaseSum0 TO FILE (oApp.gcTempPath+'casesum.txt') && Here you're missing parens!!!


>
>In the application, the above Report command is not only slow, it causes the application to hang. (That's when I observed that someting was being sent to the printer immediately after casesum.txt was created yesterday. But I can't duplicate that now because of the error it causes.) I don't think the problem has anything to do with the report, the UDF or the data. I can duplicate the issue from the command window with the simplest of reports based on a single table. Here's what I found:
>
>
>SET REPORTBEHAVIOR 90
>
>REPORT FORM Test TO FILE myfile.txt                  && Error loading printer driver
>REPORT FORM Test TO FILE myfile.txt ASCII            && Error loading printer driver
>REPORT FORM Test TO PRINTER                          && works properly
>REPORT FORM Test PREVIEW                             && works properly
>
>SET REPORTBEHAVIOR 80
>
>REPORT FORM Test TO FILE myfile.txt                  && Error loading printer driver
>REPORT FORM Test TO FILE myfile.txt ASCII            && works properly
>REPORT FORM Test TO PRINTER                          && works properly
>REPORT FORM Test PREVIEW                             && works properly
>
>Perhaps the above results were common knowledge but they were a surprise to me. Obviously I need to Set Reportbehavior 80 and use the ASCII clause when printing to file to prevent the application from hanging on the error when it tries to load the printer driver. This is occuring with SP1. It would be interesting to run the same code with SP2....

Lynda,

See the change I made inside your code. You need to use name expression in your case in that REPORT FORM command.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform