Creating a report EXIT in REPORTBEFOREPRINT
Hello,
Is there a function/routine that can be imbedded within the
ReportBeforePrint() that, after displaying a message with the
ShowMessage() routine will stop rendering followed by exiting out of the
report? We need something that upon seeing the messagebox will prevent
them from continuing on with rendering the report.
Thanks,
Joe
Is there a function/routine that can be imbedded within the
ReportBeforePrint() that, after displaying a message with the
ShowMessage() routine will stop rendering followed by exiting out of the
report? We need something that upon seeing the messagebox will prevent
them from continuing on with rendering the report.
Thanks,
Joe
This discussion has been closed.
Comments
Use the Report.OnInitializeParameters event. This event occurs prior to all
other events. Use the aCancel boolean parameter to cancel report generation;
Example:
procedure ReportOnInitializeParameters(var aCancel: Boolean);
begin
ShowMessage('This report is being cancelled');
aCancel := True; // cancel the report
end;
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
I apologise Nard. I should have made note of this in the original
request for help but we are using ReportBuilder Enterprise Edition ver
7.03.
I do not think the Report.OnInitializeParameters() event exists in this
version.
If you know which of the existing Report.xxxx events provides the
equivalent and whether the aCancel parameter is the same then I can
attempt it there.
Regardless, thank you for your assistance.
Joeseph Grubs
With newer versions, we add capabilities that are not present in prior
versions. This is a prime example in which we listened to what types of
limitations customers are encountering and then deliver enhancements
targeted at solving them.
We had customers asking how they could use RAP code to accomplish tasks
before the report engine starts generating. Things like creating parameters,
displaying custom dialogs, cancelling a report, modify a SQL query. To
facilitate this we introduced the Report.OnInitializeParmeters and
Report.BeforeOpenDataPipelines events and the TdaSQLBuilder class (for
easily modifying SQL via code).
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com