ValidationExecKey: integer;
ValidationExecKey: integer;
The ValidationExecKey property determines the key of validation rule execution.
The property values affects the workbook contents on its opening in the system interface.
If ValidationExecKey = -1, the standard workbook is displayed.
If the key of validation execution is selected, the series tree displays the series contained in validation results; the validation rule is executed on the workbook sheet.
If the key of validation execution is selected, but the execution is deleted, the empty sheet is displayed with information about deleted execution.
Executing the example requires that the repository contains a time series database with the TSDB identifier containing a validation rule with the VALID identifier. It must also contain a workbook with the WORK_BOOK identifier.
Sub UserProc;
Var
Mb: IMetabase;
RubyObj: IMetabaseObjectDescriptor;
ValiObj: IMetabaseObject;
ValidFilter: IValidationFilter;
ValidExecSett: IValidationExecuteSettings;
ValidExecRun: IValidationExecRun;
ci: IMetabaseObjectCopyInfo;
wb: IEaxAnalyzer;
Begin
// Get a validation rule
Mb := MetabaseClass.Active;
RubyObj := Mb.ItemById("TSDB");
ValiObj := Mb.ItemByIdNamespace("VALID", RubyObj.Key).Edit;
ValidFilter := ValiObj As IValidationFilter;
// Execute the rule for the whole time series database
ValidExecSett := New ValidationExecuteSettings.Create;
ValidExecRun := ValidFilter.Execute(ValidExecSett);
// Create a copy of the workbook
ci := mb.CreateCopyInfo;
ci.Source := Mb.ItemById("WORK_BOOK");
ci.Destination := ci.Source.Parent;
ci.Id := mb.GenerateId("WB");
mb.CopyObject(ci);
wb := mb.ItemById(ci.Id).Edit As IEaxAnalyzer;
// Define that the workbook contains validation results
wb.Laner.ValidationExecKey := ValidExecRun.Data.Key;
(wb As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the VALID validation rule is executed for the TSDB time series database; execution results are loaded into the copy of the WORK_BOOK workbook.
Executing the example requires that the repository contains a time series database with the TSDB identifier containing a validation rule with the VALID identifier. It must also contain a workbook with the WORK_BOOK identifier.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Laner;
…
Private Sub button2_Click(sender: System.Object; e: System.EventArgs);
Var
Mb: IMetabase;
RubyObj: IMetabaseObjectDescriptor;
ValiObj: IMetabaseObject;
ValidFilter: IValidationFilter;
ValidExecSett: ValidationExecuteSettings;
ValidExecRun: IValidationExecRun;
ci: IMetabaseObjectCopyInfo;
wb: IEaxAnalyzer;
Begin
// Get a validation rule
Mb := Self.Metabase;
RubyObj := Mb.ItemById["TSDB"];
ValiObj := Mb.ItemByIdNamespace["VALID", RubyObj.Key].Edit();
ValidFilter := ValiObj As IValidationFilter;
// Execute the rule for the whole time series database
ValidExecSett := New ValidationExecuteSettings.Create();
ValidExecRun := ValidFilter.Execute(ValidExecSett);
// Create a copy of the workbook
ci := mb.CreateCopyInfo();
ci.Source := Mb.ItemById["WORK_BOOK"];
ci.Destination := ci.Source.Parent;
ci.Id := mb.GenerateId("WB", 0);
mb.CopyObject(ci);
wb := mb.ItemById[ci.Id].Edit() As IEaxAnalyzer;
// Define that the workbook contains validation results
wb.Laner.ValidationExecKey := ValidExecRun.Data.Key;
(wb As IMetabaseObject).Save();
End Sub;
After executing the example the VALID validation rule is executed for the TSDB time series database; execution results are loaded into the copy of the WORK_BOOK workbook.
See also: