I need generate a protocol every time that a report is printed. How I know if the report was printed in a printer or other device?? (I don't need generate protocol if the report is showed only in the screen).
Take a look at the following tech tip on determining if the report was printed to the printer or not. If you need to determine which device the report was printed to you can use the TppReport.DeviceType property. (TppReport.PrintDialog.DeviceType property if you are using the printer dialog).
Comments
Take a look at the following tech tip on determining if the report was
printed to the printer or not. If you need to determine which device the
report was printed to you can use the TppReport.DeviceType property.
(TppReport.PrintDialog.DeviceType property if you are using the printer
dialog).
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I think Nico meant the one that follows.
Ed Dressel
Team DM
------------------------------------------
Tech Tip: Detecting whether Report was
Printed to the Printer
------------------------------------------
The Report.AfterPrint event can be used to
determine whether the report was printed
to the printer (rather than preview, ...).
Example:
procedure TForm1.ppReport1AfterPrint(Sender: TObject);
begin
if (ppReport1.PrinterDevice <> nil) then
ShowMessage('Report was printed to the printer');
end;
Note: If the user cancels the report while it
is running, then the Report.OnCancel event will
fire, followed by the Report.AfterPrint event.
Example:
procedure TForm1.ppReport1Cancel(Sender: TObject);
begin
ShowMessage('Printing cancelled by user');
end;
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com