The method mentioned works with variable sized data and seems to be the only 
way with variable sized data.
It must be run once to determine the total pages (this can be done in 
sub-report storing final page number in report variable to be used for total 
pages) Then the second time to print the report now that you have the total 
pages.

If the data size does not vary.
example each record uses 1 line only. then you just need to determine the 
number of records to be printed divided by
the number of records per page and if a modulus exists adding 1 to the total. 
This can be done very easily in a sub-report of the report.

You can also create a situation where each record takes up 6 lines (like a 
label) which is the max amount needed even for the largest record then you just 
need the total  records again divided by 10 (10 records of 6 lines per page) 
adding 1 if there is a modulus.

I have used each of these in the past.
You my need to run then a few times to remove "bugs"
Such as accounting for a title page, into page and or conclusion page which add 
to the count independent of the number of records.

mark
Hope all are doing great this beautiful summer!!!

________________________________
From: Dataperf <[email protected]> on behalf of Richard Bragonje 
<[email protected]>
Sent: July 19, 2019 8:55 AM
To: [email protected] <[email protected]>
Subject: Re: [Dataperf] How to print Total page count in report.


Hi Tim, and Ed,


Dredging thru my DP archives (in Eudora), i found this, from a fellow named 
"Tim Rude", with a follow up from Ralph Alvy.


Subject: Page numbers & reports...
Date: Wed, 28 May 2003 10:06:08 -0500
From: "Jay Diekmann" <[email protected]>
To: DataPerfect Users Discussion Group <[email protected]>

Hello,

I am attempting to put a "Page *** of ***" in a page footer in a report.  It is 
obvious how to get the first field, but how do I obtain the number for the 
second field?  Any help is appreciated.

Thanks,

Jay Diekmann

--

From: "Tim Rude" <[email protected]>
To: DataPerfect Users Discussion Group <[email protected]>
Subject: Re: Page numbers & reports...
Date: Wed, 28 May 2003 22:43:25 -0500

Jay,

DP doesn't know how many pages there will be until they've all been
processed. It doesn't formulate the entire report in memory and then output
it. It outputs it on the fly as it creates it.

That being the case, the only way you could know the total number of pages
to put in the page footers would be to process the entire report twice. The
first time you turn off output to the printer (or send it to NUL) and keep
track of the page total. Then process the report again with output going to
the printer.

This should work as long as all your report is doing is displaying data. If
you're using the report to update any database fields while processing you
might not want to have it happen twice.

The easiest way to accomplish this double-run thing is to run the whole
report inside a subreport. In the outer report shell, turn off Printer/File
output for the first iteration. Store the total number of pages the report
used after the subreport finishes. Then turn back on Printer/File output and
repeat the subreport, using the newly calculated total in the page footers.

Tim Rude

Date: Wed, 28 May 2003 22:00:47 -0700
From: Ralph Alvy <[email protected]>
To: DataPerfect Users Discussion Group <[email protected]>
Subject: Re: Page numbers & reports...

You must create a report that essentially runs twice. The first time it
determines the total number of pages, and stores that number in an RV,
but fails to print anything at all. The second one prints all the data.

You do this by making two *sub*reports that do the above. They are
*parallel* subreports, not *nested* subreports. The parent report runs
on a single record and then stops, since after a single parent report
record, the two subreports have finished their work.

--
Ralph Alvy
[email protected]

Subject: Page numbers & reports...
Date: Thu, 29 May 2003 07:09:49 -0500
From: "Jay Diekmann" <[email protected]>
To: DataPerfect Users Discussion Group <[email protected]>

Hello,

I am attempting to put a "Page *** of ***" in a page footer in a report.  It is 
obvious how to get the first field, but how do I obtain the number for the 
second field?  Any help is appreciated.

Thanks,

Jay Diekmann

--




--
Rich Bragonje - Database Specialist
[email protected]
304/293-8783
FAX: 304/293-2441
West Virginia University
Appalachian Hardwood Center
PO Box 6125
Morgantown, WV  26506-6125




________________________________
From: Dataperf <[email protected]> on behalf of Tim Rude 
<[email protected]>
Sent: Friday, July 19, 2019 8:44 AM
To: [email protected] <[email protected]>
Subject: Re: [Dataperf] How to print Total page count in report.

There's no way to know how many pages the report will take until it's finished 
running. So the only way I could envision doing it in DP would be to run the 
report twice inside two consecutive subreports. The first instance wouldn't 
actually output anything but would simply go through the motions to count the 
number of pages. Then the second iteration would generate the output and show 
your page count total as desired.

Tim Rude

On July 18, 2019 12:47:35 PM CDT, "Ed Marfil, MAST UNITED" 
<[email protected]> wrote:

Hello All,

Is there a way in DP reports to print on each page the total number of pages in 
the report?

For example, can the report state this page is 1 of 27 pages, 2 of 27 pages, 
etc.

Hopefully someone’s already done this and could please share the how.

Thanks all.

Ed.
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf

Reply via email to