Analyzer: IEaxAnalyzerSource;
Analyzer: IEaxAnalyzerSource;
The Analyzer property determines a data source for the component.
The UiErAnalyzer component cast to the IEaxAnalyzerSource interface should be set as a value of this property.
The UiErAnalyzer component must be connected with a workbook, for which appropriate validation rules are applied, and diagnostic test is formed.
Executing the example requires a form with the WorkbookDocumentViewerBox and ValidationLegendBox components, and the UiErAnalyzer named UiErAnalyzer1 that is a data source for them. UiErAnalyzer1 is connected to a repository workbook. It is required that the repository contains a validation rule with the VAL_RULES1 identifier, that is stored in a time series database with the TS_DB identifier. The specified procedure is a handler of the OnCreate event for the form.
Sub SAMPLEFormOnCreate(Sender: Object; Args: IEventArgs);
Var
MB: IMetabase;
ValidFilter: IValidationFilter;
ValidExecSett: IValidationExecuteSettings;
ValidExecRun: IValidationExecRun;
DiagRep: IDiagnosticReport;
Analyzer: IEaxAnalyzer;
Begin
MB := MetabaseClass.Active;
//Rule
ValidFilter := MB.ItemByIdNamespace("VAL_RULES1", MB.GetObjectKeyById("TS_DB")).Bind As IValidationFilter;
//Parameters, required to apply validation rule
Analyzer := UiErAnalyzer1.ErAnalyzer;
ValidExecSett := New ValidationExecuteSettings.Create;
ValidExecSett.Laner := Analyzer.Laner;
//Application of validation rule
ValidExecRun := ValidFilter.Execute(ValidExecSett);
//Forming of diagnostic test
DiagRep := New DiagnosticReport.Create;
DiagRep.Run := ValidExecRun;
Analyzer.DiagnosticReport := DiagRep;
//Specifying of source for component
ValidationLegendBox1.Analyzer := UiErAnalyzer1 As IEaxAnalyzerSource;
End Sub SAMPLEFormOnCreate;
On the form startup, parameters of the specified validation rule are obtained. This rule will be applied to the workbook, which is connected to the UiErAnalyzer1 component. After application of the rule the diagnostic test is formed. Information about the used validation rule is available in the ValidationLegendBox1 component.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Instead of Fore components use their Fore.NET analogs.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ms;
Private Sub SAMPLEForm_Load(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
//ValidGroup: IValidationGroup;
ValidFilter: IValidationFilter;
ValidExecSett: ValidationExecuteSettings = New ValidationExecuteSettingsClass();
ValidExecRun: IValidationExecRun;
DiagRep: DiagnosticReport = New DiagnosticReportClass();
Analyzer: EaxAnalyzer;
Begin
MB := Self.Metabase;
//Rule
ValidFilter := MB.ItemByIdNamespace["VAL_RULES1", MB.GetObjectKeyById("TS_DB")].Bind() As IValidationFilter;
//Parameters, required to apply validation rule
Analyzer := UiErAnalyzerNet1.ErAnalyzer.ErAnalyzer;
ValidExecSett.Laner := Analyzer.Laner;
//Application of validation rule
ValidExecRun := ValidFilter.Execute(ValidExecSett);
//Forming of diagnostic test
DiagRep.Run := ValidExecRun;
Analyzer.DiagnosticReport := DiagRep;
//Specifying of source for component
ValidationLegendBoxNet1.Analyzer := UiErAnalyzerNet1;
End Sub;
See also: