>Hi.
>I have a report sorted by a Group and want to Print Page x of Y within the Group, i.e.
> reset the No.of pages at the end of each group i.e.
>Group
>01 1 of 3
>01 2 of 3
>01 3 of 3
>02 1 of 4
>02 2 of 4
>02 3 of 4
>02 4 of 4
>etc
>Thanks in advance
>Regards,
>Gerard
If you are using VFP 9 SP2 ... you can do this:
In your report, set the data group to start with page 1. Use _ResetPageTotal instead of _PageTotal to print the page count on the report. Run the report using this code:
PUBLIC _ResetPageTotal, _ReportPageNo, _ReportPageTotal
LOCAL loRL
loRL = NEWOBJECT('fxListener', HOME() + 'ffc\_reportlistener')
loRL.ListenerType = 1
loRL.AddCollectionMember('fxResetPageTotal', ;
HOME() + 'ffc\_reportlistener', '', .t., .f., .f.)
REPORT FORM MyReport OBJECT loRL
_ResetPageTotal will contain the total page count for the current group.
_ReportPageNo will contain the page number of this page within the entire report (ignoring groups).
_ReportPageTotal will contain the total number of pages in the entire report.