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

Printing Multiple Copies

edited June 2006 in General
Hi everyone,

we have an invoice which we print from Report Builder. At the moment we set
print copies to whatever copies the user had setup and everything was ok.
Until we started having requests that each copy of the invoice should have a
different marking on it.

For example "Customer" or "Operations" or "Accounting" marking where every
paper should go.

The quick & dirty would be to print three times and have a flag and change
the caption of a label in the ongettext.

But the report is a bit heavy so we need to find something smarter.. Heeeelp

Comments

  • edited June 2006
    Hi Vassilis,

    -------------------------------------------------------
    Tech Tip: Printing a Unique Caption for each copy of
    of a multi-copy report sent to the printer.
    -------------------------------------------------------


    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


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

    4. Create a private variable in your form: FCopy

    5. In the Report.BeforePrint event code

    FCopy := 0;

    6. In the Report.OnStartPage event code

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


    7. 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;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2006
    Dude you're great !
This discussion has been closed.