OnAfterExecuteAnalyzer(Args: IEaxAfterExecuteEventArgs);
OnAfterExecuteAnalyzer(Args: Prognoz.Platform.Interop.Express.EaxAfterExecuteEventArgs);
Args. Event arguments.
The OnAfterExecuteAnalyzer method implements the event that occurs after table calculation.
The event occurs not only after table calculation but also after workbook calculation.
To implement the event that occurs before table calculation, use IEaxAnalyzerUserEvents.OnBeforeExecuteAnalyzer.
The example describes the class that can be used as an express report event handler.
Add links to the Dimensions, Export, Express, Metabase, Ui system assemblies.
Class ExpressRep_Events: ExpressEvents
// Implements the event that occurs before table calculation
Public Sub OnBeforeExecuteAnalyzer(Args: IEaxBeforeExecuteEventArgs);
Var
AnalyzerData: IReportData;
SheetData: IReportSheetData;
Name, NameDes: String;
DataSources: IReportDataSourcesData;
DataSource: IReportDataSourceData;
Descriptor: IMetabaseObjectDescriptor;
i, DataSourcesCount: integer;
Begin
// Get report data
AnalyzerData := Args.AnalyzerData;
// Get sheet parameters
SheetData := AnalyzerData.SheetData;
// Output sheet name
Name := SheetData.Name;
// Get collection of data sources
DataSources := SheetData.DataSources;
For i := 0 To DataSources.Count - 1 Do
DataSource := DataSources.Item(i);
// Get source description
Descriptor := DataSource.Descriptor;
// Get source name
NameDes := Descriptor.Name;
// Get number of data sources
DataSourcesCount := DataSource.DataSources.Count;
End For;
// Output information to the information window
Winapplication.InformationBox
("The OnBeforeExecute event occurred" + #13 + #10 +
"Sheet name - " + Name + #13 + #10 +
"Data source name - " + NameDes + #13 + #10 +
"Number of data sources = " + DataSourcesCount.ToString);
End Sub OnBeforeExecuteAnalyzer;
// Implements the event that occurs after table calculation
Public Sub OnAfterExecuteAnalyzer(Args: IEaxAfterExecuteEventArgs);
Var
AnalyzerData: IReportData;
SheetData: IReportSheetData;
Descriptor: IMetabaseObjectDescriptor;
Name, NameDes, NameDSDes, Id: String;
ParamValues: IMetabaseObjectParamValues;
ParamValuesCount, DataSourcesCount, OwnParamValuesCount, SelCount: Integer;
DataSources: IReportDataSourcesData;
DSDescriptor: IMetabaseObjectDescriptor;
OwnParamValues: IMetabaseObjectParamValues;
Selection: IDimSelectionSet;
Begin
// Get report data
AnalyzerData := Args.AnalyzerData;
// Get sheet parameters
SheetData := AnalyzerData.SheetData;
// Get data source parameter values
ParamValues := SheetData.DataSourceParamValues;
// Get number of data source parameter values
ParamValuesCount := ParamValues.Count;
// Get data source
DataSources := SheetData.DataSources;
// Get number of data sources
DataSourcesCount := DataSources.Count;
// Get sheet description
DSDescriptor := SheetData.Descriptor;
// Get description name
NameDSDes := DSDescriptor.Name;
// Get sheet identifier
Id := SheetData.Id;
// Get sheet name
Name := SheetData.Name;
// Get eigenvalues parameters
OwnParamValues := SheetData.OwnParamValues;
// Get number of eigenvalue parameters
OwnParamValuesCount := OwnParamValues.Count;
// Get dimension selection
Selection := SheetData.Selection;
// Get number of selection elements
SelCount := Selection.Count;
// Get report data description
Descriptor := AnalyzerData.Descriptor;
// Get name of report data description
NameDes := Descriptor.Name;
// Output information to the information window
Winapplication.InformationBox
("The OnAfterExecute event occurred" + #13 + #10 +
"Sheet name - " + Name + #13 + #10 +
"Description name - " + NameDes + +#13 + #10 +
"Number of data source parameter values = " + ParamValuesCount.ToString +
#13 + #10 +
"Number of data sources = " + DataSourcesCount.ToString + +#13 + #10 +
"Descriptor name - " + NameDSDes + #13 + #10 +
"Sheet identifier - " + Id + #13 + #10 +
"Number of eigenvalue parameters = " + OwnParamValuesCount.ToString +
#13 + #10 +
"Number of elements in selection = " + SelCount.ToString);
End Sub OnAfterExecuteAnalyzer;
// Implements the event that occurs before report print
Public Sub OnBeforePrintAnalyzer(Args: IEaxBeforePrintEventArgs);
Var
AnalyzerData: IReportData;
SheetData: IReportSheetData;
Name: String;
Begin
// Get report data
AnalyzerData := Args.AnalyzerData;
// Get sheet parameters
SheetData := AnalyzerData.SheetData;
// Get sheet name
Name := SheetData.Name;
// Output information to the information window
Winapplication.InformationBox
("The OnBeforePrint event occurred" + #13 + #10 +
"Sheet name = " + Name);
End Sub OnBeforePrintAnalyzer;
// Implements the event that occurs after report print
Public Sub OnAfterPrintAnalyzer(Args: IEaxAfterPrintEventArgs);
Var
AnalyzerData: IReportData;
SheetData: IReportSheetData;
Name: String;
PageCount: Integer;
Begin
// Get report data
AnalyzerData := Args.AnalyzerData;
// Get sheet parameters
SheetData := AnalyzerData.SheetData;
// Get sheet name
Name := SheetData.Name;
// Get number of pages
PageCount := Args.PageCount;
// Output information to the information window
Winapplication.InformationBox
("The OnAfterPrint event occurred" + #13 + #10 +
"Sheet name - " + Name + #13 + #10 +
"Number of pages = " + PageCount.ToString);
End Sub OnAfterPrintAnalyzer;
// Implements the event that occurs before report export
Public Sub OnBeforeExportAnalyzer(Args: IEaxBeforeExportEventArgs);
Var
AnalyzerData: IReportData;
SheetData: IReportSheetData;
Name: String;
Description: String;
Format: IExportFormat;
Begin
// Get report data
AnalyzerData := Args.AnalyzerData;
// Get sheet parameters
SheetData := AnalyzerData.SheetData;
// Get sheet name
Name := SheetData.Name;
// Get export format
Format := Args.Format;
// Get description of the format, in which export is performed
Description := Format.Description;
// Output information to the information window
Winapplication.InformationBox
("The OnBeforeExport event occurred" + #13 + #10 +
"Sheet name - " + Name + #13 + #10 +
"Format description - " + Description);
End Sub OnBeforeExportAnalyzer;
// Implements the event that occurs after report export
Public Sub OnAfterExportAnalyzer(Args: IEaxAfterExportEventArgs);
Var
AnalyzerData: IReportData;
SheetData: IReportSheetData;
Name: String;
PageCount: Integer;
Begin
// Get report data
AnalyzerData := Args.AnalyzerData;
// Get sheet parameters
SheetData := AnalyzerData.SheetData;
// Get sheet name
Name := SheetData.Name;
// Get number of pages
PageCount := Args.PageCount;
// Output information to the information window
Winapplication.InformationBox
("The OnAfterExport event occurred" + +#13 + #10 +
"Sheet name - " + Name + #13 + #10 +
"Number of pages = " + PageCount.ToString);
End Sub OnAfterExportAnalyzer;
End Class ExpressRep_Events;
Fore.NET objects must not be used as an event handler.
See also: