Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Page Counting in Groups

edited April 2007 in General
Hi All,

I have a report printing client end of month statements, all is working
well, grouping on the client number.

However the statement for the odd one or two clients, out of hundreds,
flows to multiple pages.

Is it possible to determine, before printing, the number of pages, and
which page is current in a group? I need a different group header and
footer on each page in these cases (brought forward balances etc). I know
how to handle first and last pages for the whole report, but I need it for
the group.

Any help much appreciated.

Cheers
David.

Comments

  • edited April 2007
    Hi David,

    If you create a two pass report (set Report.PassSetting to psTwoPass), you
    can determine the group page count before viewing each group. Inside the
    GroupHeader.BeforePrint event first check the Report.SecondPass property,
    then check the Report.PageCount. Something like the following.

    Note. Report.PageCount will give you the page count for the group/subreport
    you are currently generating. Use Report.AbsolutePageCount for the count of
    the entire report.

    if Report.SecondPass then
    if Report.PageCount > 1 then
    begin
    //Make changes
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    Hi Nico,

    Thanks, just what I needed to know.

    Cheers.

This discussion has been closed.