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

Print pages on different printers

edited April 2011 in General
Hello,

I need to print the first page of a report to a different printer then
the following pages.
I've tried it this way, but it doesn't work:


procedure TForm1.ppReportTestStartPage(Sender: TObject);
var
lPage: TppPage;
begin
lPage := ppReportTest.Engine.Page;

if ppReportTest.AbsolutePageNo = 1 then
begin
ppReportTest.PrinterSetup.PrinterName :=
qReportSettingsDruckerSeite1.AsString;
if prnSettingsPage1.Size > 0 then
begin
prnSettingsPage1.Position := 0;
lPage.PrinterSetup.LoadDeviceSettingsFromStream(prnSettingsPage1);
end;
end
else
begin
if qReportSettingsDruckereinstellungenSeite2Aktiv.AsBoolean then
begin
ppReportTest.PrinterSetup.PrinterName :=
qReportSettingsDruckerSeite2.AsString;
if prnSettingsPage2.Size > 0 then
begin
prnSettingsPage2.Position := 0;
lPage.PrinterSetup.LoadDeviceSettingsFromStream(prnSettingsPage2);
end;
end;
end;

end;


Do I miss something?
Thank you very much for your help!

Comments

  • edited April 2011
    Use a subreport with PrintBehavior set to pbSection and NewPrintJob set to
    true. You need to configure the printer name prior to the print job
    starting.

    The main report is going to represent one print job. So you need a section
    subreport to represent the other print job. A section subreport can have a
    different printersetup than it's parent.

    A child subreport prints on the parent's page space and does not have those
    behaviors.


    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.