IValidation.CalculationType

Syntax

CalculationType: MsCalculationType;

Description

The CalculationType property determines the method of validation rule calculation.

Example

Executing the example requires a form, a button named Button1 on this form, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 that is a data source for TabSheetBox. A workbook of the time series database with the OBJ_RUBRICATOR identifier should be loaded to UiErAnalyzer1. This database must contain a validation rule with the VALIDATION identifier.

Add links to the Cubes, Metabase, Ms system assemblies.

Click the button to start executing of this example.

Var
    ErAn: IEaxAnalyzer;
    Laner: ILaner;
    mb: IMetabase;
    RubrDescr: IMetabaseObjectDescriptor;
    ValidDescr: IMetabaseObjectDescriptor;
    Validation: IValidation;
    Exceptions: IValidationExceptions;
    Series: ILanerSeries;
    Exception: IValidationException;
    i: Integer;
Begin
    ErAn := UiErAnalyzer1.ErAnalyzer;
    Laner := ErAn.Laner;
    mb := MetabaseClass.Active;
    RubrDescr := mb.ItemById(
"OBJ_RUBRICATOR");
    ValidDescr := mb.ItemByIdNamespace(
"VALIDATION", RubrDescr.Key);
    Validation := ValidDescr.Edit 
As IValidation;
    Validation.CalculationType := MsCalculationType.Serie;
    Validation.StartDate := DateTime.Parse(
"01.01.2000 00:00:00");
    Validation.UseStartDate := 
True;
    Validation.EndDate := DateTime.Parse(
"01.01.2004 00:00:00");
    Validation.UseEndDate := 
True;
    Validation.Laner := 
Null;
    Exceptions := Validation.Execute(
True);
    Series := Laner.Series;
    Laner.BeginUpdate;
    
For i := 0 To Exceptions.Count - 1 Do
        Exception := Exceptions.Item(i);
        Series.AddSourceSerie(Exception.Serie 
As IRubricatorFactor);
    
End For;
    Laner.EndUpdate;

After executing the example, validation rule is calculated for the time series database. The series that do not correspond to the rule are displayed in the TabSheetBox component.

See also:

IValidation