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

Bands per record > 1 and page number

edited May 2002 in General
Hi,

I am using Rep.Builder 6.03 with Delphi 5 and Apollo.

I have a report (master - detail) which is designed whith:

Group
Header
Detail
in detail I have a subreport

Each page print, I repeat the GROUP header

The detail could have 1 page or more.

I put a page number on Header and it is working fine.

Now I want to allow the user to print more copies from each report. I set
bands per record and the got the copies, but page number continues counting.

What I want to do is reset page number? How can I do that?


News Group - Tech Tips -> is reseting and I lost the messages. Is it
something wrong with my OUTLOOK EXPRESS or the problem it?s yours?

Best regards

Sergio Melchiori

Comments

  • edited May 2002
    To print copies, don't use the BandsPerRecord property.

    Here's example of sending 3 copies to the printer and printing a unique
    caption for each one.


    1. Set Report.PrinterSetup.Collation to True

    2. Set Report.PrinterSetup.Copies to 3


    2. Set the Report.PassSetting to psTwoPass. (add ppTypes to your "uses"
    clause)

    3. Create a private variable in your form: FCopy

    4. In the Report.BeforePrint event code

    FCopy := 0;

    5. In the Report.OnStartPage event code

    if ppReport1.SecondPass and (ppRepor1.AbsolutePageNo = 1) then
    Inc(FCopy);


    6. Add a Label to the Report and in the OnPrint event code something like:

    case FCopy of
    1: ppLabel1.Caption := 'Shipping';
    2: ppLabel1.Caption := 'Order Processing';
    3: ppLabel1.Caption := 'Account Receivable';
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.