AfterPrint
My problem is the folow:
i can?t capture the 'After Print' event, because when printing in other
units i call the ppReport1, wich is located at the main form.
I writed some code at the 'After Print' event, and then debugging the
compiler don?t enter this event after i send the report to the printer.
any help?
Marcelo
i can?t capture the 'After Print' event, because when printing in other
units i call the ppReport1, wich is located at the main form.
I writed some code at the 'After Print' event, and then debugging the
compiler don?t enter this event after i send the report to the printer.
any help?
Marcelo
This discussion has been closed.
Comments
If you have access to the report object, then you should be able to assign
the AfterPrint event. Are you by chance loading a template? If so, you may
be loosing your references to the event handler.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
then printing it.
Show i write the code inside the RAP?
If i do that, can i write a sql code there to update a field in the
database?
I'm unclear about what you are trying to accomplish. If you are loading
templates, then that is definitely the reason your AfterPrint event is not
firing. As a rule of thumb, you should never alter the data while a report
is generating. Which data are you trying to change and how are you changing
it? If you need to populate a dataset based on report calculations, you
could possibly make these calculations outside the report and update the
dataset completely separate from ReportBuilder.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have orders beeing printed, and i want to update a field in the orders
table, wich one stores the date when the order was first printed out to he
paper.
I load the template, the user send the order to the printer, i capture
this event and set the field in the orders table with the actual date.
Marcelo
This would definitely be possible using a RAP pass thru function. In the
AfterPrint event in RAP, simply call the pass thru function to update your
dataset with the actual date.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Since there is no way to access outside objects in RAP you will need to
create a pass thru function in delphi that is registered and called from RAP
to do so. There is an example of creating a pass thru function located in
the ReportBuilder Developer's Guide.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
It works ok! BUT,
when i call that function at the 'AfterPrint' event, that event occurs
when the preview screen show up, not when i send the report to the printer.
May be i can use the 'on print dialog close' event, but then how can i
detect (on the Rap) if the user press OK or Cancel ??
Help!
Marcelo