OnPrintingComplete
Good afternoon to all,
I have this problem :
I use a ppReport and I must to set a boolean variable after the print : the
print and not preview, so I decided to use the event OnPrintingComplete.
When I try it in a empty report (showing message into OnPrintingComplete) I
haven't problems, but when I do the same thing in a report (with calc), seem
that that event isn't called.
Is it possible?
Anyone did have the same problem?
Thank you..
Nicoletta
I have this problem :
I use a ppReport and I must to set a boolean variable after the print : the
print and not preview, so I decided to use the event OnPrintingComplete.
When I try it in a empty report (showing message into OnPrintingComplete) I
haven't problems, but when I do the same thing in a report (with calc), seem
that that event isn't called.
Is it possible?
Anyone did have the same problem?
Thank you..
Nicoletta
This discussion has been closed.
Comments
ty
"Nicoletta Rottino" ha scritto nel messaggio
------------------------------------------
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;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
preview, when I close the window without print, it called anyway AfterPrint.
And Also if I use AfterPrint, this event don't be generate.
I think It so strange the situation : using empty report, it's generated
OnPrintingComplete event; using a report with calc, no.
Why?
Nicoletta
Yes, this is why you check if the Printer Device is not nil. If it isn't,
the report is being printed to the printer and you can set your boolean
value.
In my testing, the AfterPrint event always fires after a report has finished
printing.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
and why it not called at the end of print?
NB : I open preview and I print using button in preview.