IValidationExceptions.Item

Syntax

Item(Index: Integer): IValidationException;

Parameters

Index. Series index in the collection.

Description

The Item method returns a series from the collection by its index.

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. Workspace of the time series database OBJ_RUBRICATOR must be loaded to UiErAnalyzer1. This database must contain a validation rule with the VALIDATION identifier.

Click the button to start executing of this example.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

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;

End Sub Button1OnClick;

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:

IValidationExceptions