Retaining Printer setup between reports
I want to print a series of separate reports one after the other but only
show the print setup dialog for the first one and remember the print
settings for the others.
The reason for this is that I have split down a previous complex set of
subreports into simpler single ones as I find it more reliable and much
easier to debug.
Is there a simple way of retaining Print settings between reports or will I
need to handle all the separate print parameters myself?
Peter Harris
show the print setup dialog for the first one and remember the print
settings for the others.
The reason for this is that I have split down a previous complex set of
subreports into simpler single ones as I find it more reliable and much
easier to debug.
Is there a simple way of retaining Print settings between reports or will I
need to handle all the separate print parameters myself?
Peter Harris
This discussion has been closed.
Comments
templates. Before calling Print for the first time set the
Report.SavePrinterSetup property to True. After the first report has been
printed set Report.ShowPrintDialog to false and iterate over the rest of the
templates to load and print each one.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
own query to work from. I have not used templates though and will look
into your suggestion.
Thanks
Peter
"Alexander Kramnik (Digital Metaphors)" wrote
you save the printer setup from the first printed report. For example:
FReports: array[0..x] of TppReport;
FPrintSetup: TppPrinterSetup;
...
FReports[0].DeviceType := 'Printer';
FReports[0].OnPrintDialogClose := DoOnPrintDialogClose;
FReports[0].Print;
for liIndex := 1 to x - 1 do
begin
FReports[liIndex].ShowPrintDialog := False;
FReports[liIndex].DeviceType := 'Printer';
FReports[liIndex].PrinterSetup.Assign(FPrintSetup);
FReports[liIndex].Print;
end;
...
{ Lastly implement the first report's OnPrintDialogClose event to save the
printer setup object. }
procedure TForm1.DoOnPrintDialogClose(Sender: TObject);
begin
FPrintSetup := TppPrinterSetup.Create(nil);
FPrintSetup.Assign(ppReport1.PrinterSetup);
end;
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Peter
"Alexander Kramnik (Digital Metaphors)" wrote