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

Successefull call to Print method...

edited June 2003 in End User
Hi,
How do I know if the call to the TppReport.Ptint method was successefull or
not?
Is there some porperty I need to check in order to find that out?

Thanks,
MB.

Comments

  • edited June 2003
    Hi Moisey,

    You can use the following method to check if the report was successfully
    printed to a specified device... such as a printer.

    ------------------------------------------
    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;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.