Jump to content
TurboMagic

FastReports event signalling finalization of a report output

Recommended Posts

I'm using FastReports Embarcadero edition.

I'm looking for an even which signals me, that the report has been output
(saved as PDF or sent to the printer).

 

I haven't really found a suitable event yet. Maybe I just overlooked it?

Share this post


Link to post

Did you try OnAfterPrint for the frxReport in question? Note that a report is not always output - the user could close the preview and/or printer dialogs without printing. 

Share this post


Link to post

Thanks, will try this one!
In those cases where I print/output without preview the user cannot cancel 😉

Share this post


Link to post

The event would be used to clear some data once the output has been created and thus Fast Reports no longer needs to have access to that data. Since the output is mandatory that shouldn't be problematic.

Share this post


Link to post

I wrote the OnAfterPrint events into some log now and it looks now, that this is not called after printing the complete report, but after printing each "component" on it.

Reading the manual I find this confirmed: it is called after each band at least. I was looking for something being called after the complete report has been output.

Share this post


Link to post
On 8/9/2023 at 8:09 PM, TurboMagic said:

The event would be used to clear some data once the output has been created and thus Fast Reports no longer needs to have access to that data.

Is the answer I gave you on May 21 in forum Delphi-PRAXIS (DE) not helpful? Both links point to an example with source code.

 

With best regards
Thomas

Share this post


Link to post

I'll try to find the time to look into those examples tomorrow. I have to find the cause of some memory issue where my report generating class gets
an interface reference, which it stores as a field in the object instance.  It takes some of the data from it and assigns that to the report components

in OnGetValue event. But when that event is called, the field with the interface reference is NIL!

 

I haven't found out yet, who nils that reference or who overwrites that memory... 😞

Share this post


Link to post

Perhaps OnAfterPrintReport which while not in the docs is in the list of events in the IDE. 

Edited by Brian Evans

Share this post


Link to post
1 hour ago, Brian Evans said:

Perhaps OnAfterPrintReport which while not in the docs is in the list of events in the IDE. 

The event OnAfterPrintReport is fired only after printing. It is not fired during export (unless frxDotMatrixExport).

 

With best regards
Thomas

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×