Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System Variable for Total No. of Pages?
Message
 
To
16/05/2001 12:59:00
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00507933
Message ID:
00508065
Views:
22
>>Is there a system variable for the total number of pages in a report?
>>
>>Such that you could have an expression something like:
>>
>>
>>
>>"Page " + ALLTRIM(STR(_pageno)) + " of " + ALLTRIM(STR(_<totalpages>)
>>
>>
>>
>>TIA, Chuck
>
>Chuck,
>
>The accepted way is to print the report first to a file, get the total pages, then print to paper. So if you use a variable TotalPages it your report it would look like this:
>
REPORT FORM MyReport to FILE TempRept.prn NOCONSOLE
>TotalPages = _PageNo
>DELETE FILE TempRept.prn
>REPORT FORM MyReport TO PRINT NOCONSOLE
>
>It doesn't take long to print to the file and it gets you the right number of pages.

David,

Thanks a lot for the help. It works well!

For the record, here's what I ended up with:
* Print Report
SELECT curHatFiRep && Report CURSOR containing records to report
PUBLIC mTotalPages
STORE 1 TO mTotalPages && Initial value to eliminate error with REPORT FORM.
REPORT FORM HatFiRep TO FILE TempRept.prn NOCONSOLE
DELETE FILE TempRept.prn
STORE _PageNo TO mTotalPages && Actual value.
REPORT FORM HatFiRep TO PRINTER PROMPT NOCONSOLE
Thanks Again,
Chuck
Chuck Henry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform