To work with the tool in Foresight Analytics Platform 10, use the new interface.

The Event Handling Tab

To work with event handlers, go to the Event Handling tab of the Report Units and Event Handling dialog box:

In the Unit drop-down list select an object that contains a class implementation for handling regular report events. The list contains all objects added on the Units tab. The selected object must contain description of a class inherited from the ReportEvents class that contains implementation of methods for handling regular report events. Specify class name in the Class field.

Event handler class description can be created automatically. To create a new unit, click the Create button and select the required handler type. A class that contains templates of event handlers for all report events is created in the specified repository folder.

Event handler class can have the designer called at each class initialization. The designer must not contain parameters. If the class has several constructors without parameters, the first constructor is called (located above the others in the code).

NOTE. Event class is initialized each time when an action is executed in the report. In this case wither one event or a chain of events can be generated.

Example of Event Handler

To show an information message that contains specific data each time after the regular report data area is calculated, create a unit in the Object Navigator window. Add links to the Report and Ui assemblies:

Class EventsClass: ReportEvents
    //Designer opened at initialization of the EventsClass class
    Constructor Create;
    Begin
        //Initialization of objects
    End Constructor Create;
    //Event that occurs after data area of a regular report has been calculated
    Public Sub OnAfterExecuteDataIsland(DataIsland: IPrxDataIsland);
    Begin
        WinApplication.InformationBox("Data area has been calculated: " + DataIsland.Id);
    End Sub OnAfterExecuteDataIsland;
End Class EventsClass;

The occurred event shows an information message containing the identifier of the calculated data area.

See also:

Getting Started with the Reports Tool in the Web Application | Handing Report Events