Detecting whether report printed to printer
Hello,
my Reports are shown in the Preview-Form.
The User can close the Form or he select PDF-Export from the Printer-Dialog
or want's to print to the Printer.
How can i check, if the Report was printed to the Printer?
I followed the Wiki-Example:
procedure TForm1.ppReport1AfterPrint(Sender:TObject);
begin
if (ppReport1.PrinterDevice<>nil) then DoSomething
end;
but with PDF-Export the PrinterDevice is <>nil, too.
How to find out printed to Printer?
Jürgen
my Reports are shown in the Preview-Form.
The User can close the Form or he select PDF-Export from the Printer-Dialog
or want's to print to the Printer.
How can i check, if the Report was printed to the Printer?
I followed the Wiki-Example:
procedure TForm1.ppReport1AfterPrint(Sender:TObject);
begin
if (ppReport1.PrinterDevice<>nil) then DoSomething
end;
but with PDF-Export the PrinterDevice is <>nil, too.
How to find out printed to Printer?
Jürgen
This discussion has been closed.
Comments
When printing a report from the print dialog, the printer device will always
be created. You can also check (TppReport.FileDevice <> nil) to determine
if the report was then exported to a file.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Perfect.
if (Report1.PrinterDevice<>nil) and (Report1.FileDevice=nil) then
DoSomething
is the trick that works for me.
Thank you very much
Jürgen