One of the methods for expanding reports functionality is handling events fired when the user works with a report.
An event handler enables the user to execute a specified operation each time the event occurs. For example, on connecting event processing unit, the following options become available:
Process entered data on-the-fly.
Show confirmation dialog box for executed operation.
Execute additional operation before and after an event occurs.
Show information messages that contain particular information (such as identifier of the changed control, hyperlink type and so on) and others.
Regular reports enables the user to set up handling of the events that occur:
Before opening regular report.
Before and after changing the regular report active sheet.
Before and after calculating a data area (or relational data area), regular report as a whole or a specific report sheet.
Before and after printing and exporting regular report.
Before and after saving changed values of data areas.
On changing value of regular report control.
Before saving regular report, and so on.
Main purpose of connection of application macros and event handlers:
Creating hyperlink triggers. If executing macros contained in the connected objects is required as their operations.
Creating formulas.
Event handling. To handle events, describe a class inherited by the ReportEvents class, and redetermine methods that implement the required events.
NOTE. On using of .NET assembly it is required to describe a class that implements events of the IPrxReportUserEvents interface.
Signature of the specified macro can contain parameters.
To connect an event handling unit, click the Connect Unit button on the Development ribbon tab. A repository objects selection dialog box opens.
To work with an event handler, click the Event Handling button on the Development ribbon tab and select one of the following operations:
Create an event handler.
Disable event handler.
To set up event handling, click the button at the bottom right corner of the Units button group on the Development ribbon tab. The Report Units and Event Handling dialog box opens. This dialog box has the following tabs:
Units. It is used to work with the list of objects available for use in the regular report.
Event Handling. It is used to work with event handlers.
See also: