OnHeaderChange(Value: IDimInstance);
Value. Data of the dimension linked related with table header change.
The OnHeaderChange method implements the event that occurs on changing table header.
Executing the example requires that the repository contains a form with the UiErAnalyzer component named UiErAnalyzer1, and the EaxDocumentViewerBox and ErAnalyzerDimPanel components. UiErAnalyzer1 is set as a data source for EaxDocumentViewerBox and ErAnalyzerDimPanel. 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 header change
Public Sub OnHeaderChange(Value: IDimInstance);
Begin
Debug.WriteLine("Header is changed. Used dimension: " + Value.Name + '(' + Value.Ident + ')');
End Sub OnHeaderChange;
End Class Pivot_Events;
Class TESTForm: Form
UiErAnalyzer1: UiErAnalyzer;
EaxDocumentViewerBox1: EaxDocumentViewerBox;
ErAnalyzerDimPanel1: ErAnalyzerDimPanel;
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. If headers structure changes in the ErAnalyzerDimPanel component, the development environment console displays information about moved dimension.
See also: