Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page # of ##
Message
From
05/03/2004 16:27:31
 
 
To
05/03/2004 16:11:16
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00883682
Message ID:
00883685
Views:
6
>In my report I'd like to show page number of total pages. The problem is that I am resetting page number on every group. So to be done to a total pages per group. Is there a way of doing that?

I can't think of an easy way but here's an idea that might work.

For a standard report where you're not resetting the page number on every group, you run the report twice; after the 1st pass the _PAGENO variable can be stored to another variable so you can get #/## on the 2nd pass.

In your case, you still have to run the report twice, but record multiple maximum page numbers instead of just 1. First, you will need to create a cursor with 2 columns: GroupByValue and MaxPageNum. In each Group Header you'll put a call to a UDF that INSERTs a new record in the cursor, with the current GroupByValue. In each Group Footer you'll put a call to a UDF that writes the MaxPageNum value to the cursor and resets the _pageno value appropriately.

To print "Page #/##" you'll need to create a 3rd UDF that looks up the MaxPageNum value when passed the current GroupByValue. This UDF will have to handle the case where the value isn't found on the 1st pass, but is found (and therefore printed) on the 2nd pass.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform