Take a look at faq814-2911, or serach on the Microsoft knowledge base where they suggest another solution, that doesn't involve printing the report to a temp file.
Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
Or if you are using VFP 8.0, this is "native" - just use the system variable _pagetotal. Note: VFP 8.0 effectively does the same thing as the FAQ does, it's just hidden from you. Therrefore the normal warnings about updating any data in running the report still apply (i.e. it'll actually happen twice!).
You can do it like this
Create a variable named 'nTotalPages' for example and put it in your Report
Public nTotalPages
REPORT FORM Myreport.Frx NOCONSOLE
nTotalPages = _pageno
REPORT ForM Myreport.Frx 'Preview' or 'To Printer' ...
when you print your report the 2nd time to Preview or to file or to printer as you like you will have the total number of pages in the variable nTotalPages.
I tried both of the suggestions and each time I ran it it would come back with page 1 of 1, page 2 of 1, page 3 of 1 and so on. If there are any more suggestions they would be greatly appreciated.
Thanks
It would seem you are missing the point that the report expression would use some thing like:
"page "+alltrim(str(_pageno))+" of "+alltrim(str( nTotalPages))
No, i have all of what was posted. It seems to me as though nTotalPages is not being set properly.
Are you refering to the solutions proposed by Shevshenko, or the faq I pointed to? The solution suggested by Shevshenko is know under certain circumstances to report a wrong total page number.
Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
How about calculate the total page yourself. I mean like count the record to print and divide it by how many details for one page. I think you can work it out.
Btw in VFP8 there is a new System Variable for this purpose: _PageTotal
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.