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

Back-to-Back w/o printer dialog

edited September 2006 in General
RB 10.04, Delphi 7 -- I am printing two reports consecutively with the
second report "ShowPrintDialog" set to false so the operator won't have to
interact at that point.

How to I ensure that the second report will be printed to the same printer
selected for the first? Right now after the first prints, I am using
"Report2.printersetup.printername:=Report1.PrinterSetup.printername" but the
second report reverts to the default printer rather than continuing with the
printer selected for the first report.

Thank very much for your help.

Bill Skelton

Comments

  • edited September 2006
    Hi Bill,

    Where are you setting the printer name of the second report? A good place
    to set this propery is in the AfterPrint event of the first report. In my
    testing with a setup similar to your own, calling
    Report2.PrinterSetup.PrinterName := Report1.PrinterSetup.PrinterName; from
    the AfterPrint of the first report worked correctly.

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppReport1.Print;
    end;

    procedure TForm1.ppReport1AfterPrint(Sender: TObject);
    begin
    ppReport2.PrinterSetup.PrinterName := ppReport1.PrinterSetup.PrinterName;
    ppReport2.Print;
    end;

    --
    Regards,

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

    Best Regards,

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