IPivotEvents.OnBeforeDataSourceExecute

Syntax

OnBeforeDataSourceExecute(DestinationSel: IDimSelectionSet);

Parameters

DestinationSel. Data source dimension selection, according to which data source is calculated.

Description

The OnBeforeDataSourceExecute method implements the event that occurs before data source calculation.

Example

Executing the example requires that the repository contains a form with the UiErAnalyzer component named UiErAnalyzer1 and the EaxDocumentViewerBox component. UiErAnalyzer1 is set as a data source for EaxDocumentViewerBox. A express report is connected to UiErAnalyzer1.

Add links to the Dimensions, Express, Pivot system assemblies.

Public Class Pivot_Events: PivotEvents
    // Event that occurs before data source calculation
    Public Sub OnBeforeDataSourceExecute(DestinationSel: IDimSelectionSet);
    Var
        Sel: IDimSelection;
    Begin
        Debug.WriteLine("Selected in dimension:");
        Debug.Indent;
        For Each Sel In DestinationSel Do
            Debug.WriteLine(Sel.Dimension.Ident + ": " + Sel.SelectedCount.ToString);
        End For;
        Debug.Unindent;
    End Sub OnBeforeDataSourceExecute;
End Class Pivot_Events;

Class TESTForm: Form
    UiErAnalyzer1: UiErAnalyzer;
    EaxDocumentViewerBox1: EaxDocumentViewerBox;
    Pvt: IPivot;
    Cookie: Integer;

    Sub TESTFormOnShow(Sender: Object; Args: IEventArgs);
    Var
        Express: IEaxAnalyzer;
        Events: Pivot_Events;
    Begin
        // Get express report
        Express := UiErAnalyzer1.ErAnalyzer;
        // Get settings for displaying report data table
        Pvt := Express.Pivot;
        // Allow event generation
        Pvt.EventsEnabled := True;
        // Create an class instance for event handling
        Events := New Pivot_Events.Create;
        // Connect table event handler
        Cookie := Pvt.AddEventHandler(Events);
    End Sub TESTFormOnShow;

    Sub TESTFormOnClose(Sender: Object; Args: IEventArgs);
    Begin
        // Remove event handler
        Pvt.RemoveEventHandler(Cookie);
    End Sub TESTFormOnClose;
End Class TESTForm;

When a form is started, a custom event handler is connected for express report table. Before data source calculation, the console window displays information about the set selection.

See also:

IPivotEvents