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

How to do it ?

edited September 2004 in General
Hello,
I am using RB7 Entreprise.
I want to print 3 copies of an invoice. On the first copy I want to print a
label, and a different one on the others copies.
Please can you help ?
Thanks

Comments

  • edited September 2004
    the easiest way is to print the same report 3 times
    and set the desired label invisible or visible as necessary
    it shouldn't take more then 5 seconds to do what you want...
    if you all want it to happen in 1 report in 1 single print instruction then
    there is some more work involved depending on your needs...
    cu
    marc

  • edited September 2004
    -------------------------------------------------------
    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;



    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com

    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2004
    Thanks a heap.
    That is what I was looking for.
    Ben
  • edited September 2004
    Hi Nard,
    Sorry, but it seems that this will not work in my case.
    Because it assumes that each copy has exactly one page, which is not my
    case. I want to print the same label on all pages of a same copy, but
    different for each copy.
    Thanks for help
    Ben
  • edited September 2004
    Hi Ben,

    Try placing the OnPrint code inside the OnStartPage event just below the
    existing code. Another option would be to place the label inside the
    PageStyle band which prints in the background of each page in the report.
    Then update the label in the PageStyle.BeforePrint event.
    Below is a link to an example of this method...

    http://www.digital-metaphors.com/tips/UniqueCaptionForEachCopy.zip

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.