Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find how many pages in repo form

Status
Not open for further replies.

ivancs

Programmer
Jun 13, 2001
13
BR
my example:
Repo form myrepo to print for code >100
repo form myrepo to print for code <100
Inside of my repo form I Show the page's numbers.
If I use the example below my page number will be reset.
It is not what I want.
The 1º Repo form start with page number 1 and the second has to be a sequence.

My second problem is Whem I am printing the repo form I like to Know how many page I have to print at the Header like this
Begin/End
Page:0001/0010
Is foxpro store to any variable like the number of pages??
 
To get consecutive report page numbers, save off the _PageNo from the first report (e.g. into lnPageStart), and then in the second report use the expression lnPageStart+_PageNo instead of just _PageNo.

To get the total number of pages to be printed, you need to run the report twice. The first time add the &quot;NOCONSOLE TO FILE dummyfile.dat&quot; clause and save off the total pages, then delete the file and run it again. (Note: No other method has been shown to work reliably. Due to differences in printer drivers the number of lines can't usually be calculated accurately except in very simple reports. Even this method can mislead if the report is large enough and the underlying data can be changing.)

Rick
 
Hi ivancs,
The solution given by rgbean is correct and i think is the only solution to get the consecutive page numbers. But to know the total no. of pages of a report, you don't have to generate a text file (dummyfile.dat in above case).
If you issue this command,
REPO FORM myReport NOCONSOLE
It will set the _PAGENO variable to the last page of the report. (Be careful if report does not have any data to print still _PAGENO will give you 1).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top