Report Printed

Hello

how can I find out that my report was printed (at this instance)?

Maybe as a property:
if oFReport.IsPrinted = true then
...

or is a special event available?

I saw many other topics like this from other users...
Is a solution available or in one of the next releases?

Best regards,
Stefan

Comments

  • edited 2:40PM
    Hello,

    Report is considered printed when you press the OK button in the print dialog.
    Use the following code if you want to show the "Print" dialog, then print:
    report.Load(...);
    if (report.Prepare())
    {
      PrinterSettings printerSettings = null;
      if (report.ShowPrintDialog(out printerSettings))
      {
         report.PrintPrepared(printerSettings);
         // at this point, the report is printed.
      }
    }
    
  • edited 2:40PM
    Hello,

    thank you for your response.
    I will implement and test it.

    Best regards,
    Stefan Drwes
  • edited 2:40PM
    Hello AlexTZ,

    your solution works pretty good, but I wanna use the default print preview.
    Is it possible there?
    I don't wanna create a new one... >
  • edited 2:40PM
    Hello,

    I will add the ReportPrinted event in the next daily build (tomorrow). You will be able to use it as follows:

    using FastReport.Utils;

    Config.ReportSettings.ReportPrinted += new EventHandler(Report_Printed);
  • edited 2:40PM
    Hello AlexTZ,

    perfect - thank you very much!

    Best regards,
    Stefan Drews

Leave a Comment