Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any quick way to do running totals on page numbers?
Message
 
To
19/01/2005 16:36:47
Alp Berker
Defense Finance and Accounting Services
Indianapolis, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00978689
Message ID:
00978699
Views:
15
>Hello to Everyone,
>Is there a quick an effortless way to keep track of page numbers out of a total? for example the report whould have running page totals page 3 of 10? Each page would say which one it is out of a total. I didn't see a quick way of doing this like in Access etc. Maybe doing sometinhn with _pageno?
>Thanks for your suggestions,
>Alp Berker
>aberker@yahoo.com

I have a report class that takes care of this for me. Replace code as needed such as “ThisForm.pReportName” with the name of your Report. This code could be in a method of your form or in the Click of a button.
* Get the total number of pages...
PRIVATE pnPages
pnPages = 0
* This value will be passed to the report to indicate
* the total number of pages....

LOCAL lcFile
* Create a temporary file based on the report to be run...
lcFile = SYS(3) + ".TMP"
REPORT FORM (ThisForm.pReportName) TO FILE (lcFile) NoConsole

* Erase the file-it is no longer needed....
Erase(lcFile)
* Now we have the total number of pages of the report...
pnPages = _PAGENO


DO CASE 
* View report on screen...
	CASE ThisForm.cntOutput3.opgOutput.Value = 1	
		REPORT FORM (ThisForm.pReportName) PREVIEW
* Print the report...
	CASE ThisForm.cntOutput3.opgOutput.Value = 2
		REPORT FORM (ThisForm.pReportName) TO PRINTER PROMPT NOCONSOLE
ENDCASE
Now on the Report Footer place a label with some text – Page Number – then drop on a field from the Report Controls Toolbar next to your label (Page Number). Give it a value of _PAGENO. Repeat this process with a second field object and give it a value of pnPages.


Tom
Previous
Reply
Map
View

Click here to load this message in the networking platform