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

ShowPrintDialog

edited March 2002 in General
Hi,

Does ReportBuilder support showprintdialog when sending mulitple reports to
the printer as one print job? If so could you tell me how to include the
"showprintdialog" with the code I have provided below. Any help would be
appreciated.


============================================================================
====
procedure TForm1.buttonPrintClick(Sender: TObject);
var
lPrinterDevice : TppPrinterDevice;
integerX : integer;
begin
integerReportNo := 1;
lPrinterDevice := TppPrinterDevice.Create(self);
lPrinterDevice.PageSetting := psAll;

lPrinterDevice.StartPrintJob := True;
lPrinterDevice.EndPrintJob := False;

for integerX := 0 to tableReportTemplates.RecordCount - 1 do
begin
Report.Template.DatabaseSettings.Name := 'ReportPage' +
inttostr(integerReportNo) + 'Template';
Report.Template.LoadFromDatabase;
lPrinterDevice.Publisher := Report.Publisher;
Report.PrintToDevices;
inc(integerReportNo);
lPrinterDevice.StartPrintJob := False;
end;
lPrinterDevice.EndPrintJob := True;
lPrinterDevice.Free;
end;{buttonPrintClick}
============================================================================
====

TIA,

Jada Case

Comments

  • edited March 2002
    Set Report.SavePrinterSetup to True. Now, you should be able to show the
    print dialog once, and then all subsequent PrintToDevices calls will use the
    printer setup from the first time you show the print dialog. Set
    Report.ShowPrintDialog to true for the first report, and false for all
    subsequent reports.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.