If for example, I have a 5 page report, does anyone know how to make the report read page 1 of 5, page 2 of 5, etc without first having to print the report to see how many pages there are? (I am using RPGLE)
Software/Hardware used:
ASKED:
November 14, 2007 7:06 PM
UPDATED:
May 19, 2008 11:25 AM
Hi,
If you know how many lines you have available to print on on a page and you know how many lines of data you’re going to print, then you can calculate how many pages you have to print in total.
For example you can print 10 order lines on a page, you have 127 order lines to print, then you have 13 pages, so you could print 1 of 13, through to 13 of 13.
Depending on your database and software, you could use SQL to first do a count of the records you have available to print (within your selected range).
Hope this helps,
Martin Gilbert.
Hi
There is aome API which is to do this activity.
If U need Some Logic then we can have like:
First create the Spool file with a counter variable to hav the Total number of pages in the Program.Then Copy it to a flat file using Cpysplf then Using SQL u can Replace the Text YY in the file( XX of YY) with the final value of the Counter variable.then again overide the File to the Spool file using OVRPRTF
Thanx
Reshma