OnReportPrint event is not always fired
When you use the designer and press F9 to test it then the OnReportPrint event will be fired after you've pressed the PRINT Button (left upper corner) and choose a printer. But when you use the following code inside delphi to preview and/or direct print it's not fired. The events OnStartReport, OnStopReport works in all cases fine. But again the OnReportPrint event is only fired when you used the designer first.
IF (rbPreview.Checked) THEN
BEGIN
IF PrepareReport
THEN
ShowPreparedReport;
END;
IF (rbPrinter.Checked) THEN
BEGIN
PrepareReport;
Print;
END;
The problem seems to be inside the frxPreviewPages.pas:
Report.DoNotifyEvent(Report, Report.OnReportPrint, not Report.EngineOptions.DestroyForms);
The parameter "not Report.EngineOptions.DestroyForms" is not correct in these two described cases.
Thanks in advance for your quick support!
Kind regards
IF (rbPreview.Checked) THEN
BEGIN
IF PrepareReport
THEN
ShowPreparedReport;
END;
IF (rbPrinter.Checked) THEN
BEGIN
PrepareReport;
Print;
END;
The problem seems to be inside the frxPreviewPages.pas:
Report.DoNotifyEvent(Report, Report.OnReportPrint, not Report.EngineOptions.DestroyForms);
The parameter "not Report.EngineOptions.DestroyForms" is not correct in these two described cases.
Thanks in advance for your quick support!
Kind regards
Comments
Set TfrxReport.EngineOptions.DestroyForms to False