Is report prepared?

Hello,

In my delphi code, I'm printing a report by using the methode "Tfxreport.print"
Sometimes, this report is allready prepared, because one has opend it with preview.

After he decided to close the preview, he want's to print it by using the above mentioned methode.

In this case I wouldn't have to prepare the report again.

I programmed the Event TfxReport.OnReportPrint. There, I do the preparation.
So, the printer options dialog is opened and if user confirms with OK, the preparation should be executed.

I tried it with TfxReport.Engine.TotalPages > 0. This didn't work, because it is 0

Has there someone an idea on hwo to do this ?
Is it good practice, to use that event handler or do I have a better way?

Comments

  • edited 2:15PM
    You it is necessary to do report Doublepass:
    frxReport.Engine.DoublePass:=True;
    
  • edited 2:15PM
    In the TfxReport.OnReportPrint Event:
    if frxReport1.Engine.FinalPass then
    begin
    //your code
    end;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.