Report Units and Event Handling

To extend report functionality, use:

Main purpose of connection of application units and event handlers:

One can set up handling of the report events that occur:

Working with Report Units/Event Handler

To work with report units and event handler, use the List of Units panel:

To open the panel

The following operations are available when working with report units and event handler:

Create a unit/event handler

Create event handler automatically

Connect an existing unit/event handler

Reset event handler

Open unit/event handler in development environment

Remove unit/event handler from the list

Example of Event Handler

To execute the example, create a unit. Add links to the Drawing, Express, Report, and Tab system assemblies.

Class EventsClass: ReportEvents
    // Event that occurs  after report sheet calculation
    Public Sub OnAfterRecalcSheet(Sheet: IPrxSheet);
    Var
        Tab: ITabSheet;
        Range: ITabRange;
        Style: ITabCellStyle;
    Begin
        // Get report sheet table
        Tab := Sheet As ITabSheet;
        // Select cell range to be colored
        Range := Tab.Cells(00105);
        // Set formatting style for selected range
        Style := Range.Style;
        // Set green color of background for selected cell range
        Style.BackgroundBrush := New GxSolidBrush.Create(GxColor.FromName("Green"));
    End Sub OnAfterRecalcSheet(Sheet: IPrxSheet);
End Class EventsClass;

As a result, when the event occurs that follows regular report sheet calculation, background of the A0:F10 cell range is filled with green color.

See also:

Building Report