SaveModel: IMetabaseObjectDescriptor;
The SaveModel method saves a group of calculated series to the model.
Executing the example requires a form with the Button1 button, the Memo component with the Memo1 identifier, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 which is used as a data source for TabSheetBox. Workbook of the time series database must be loaded to UiErAnalyzer1. The workbook must contain a group of calculated series.
Click the button to start executing this example.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ErAn: IEaxAnalyzer;
Laner: ILaner;
Serie: ILanerSerie;
GroupSerie: ILanerCalculateGroupSerie;
j: Integer;
Begin
ErAn := UiErAnalyzer1.ErAnalyzer;
Laner := ErAn.Laner;
For j := 0 To Laner.SeriesList.Count - 1 Do
Serie := Laner.SeriesList.Item(j);
If Serie.Kind = LnSerieKind.CalculateGroup Then
GroupSerie := Serie As ILanerCalculateGroupSerie;
GroupSerie.Expanded := True;
Memo1.Lines.Add("Calculated series group: " + GroupSerie.Name);
Memo1.Lines.Add("Errors: " + GroupSerie.Error);
GroupSerie.SaveModel;
Memo1.Lines.Add("Group is saved to the model: " + GroupSerie.Model.Name);
End If;
End For;
End Sub Button1OnClick;
After executing the example the group of calculated series is saved to the model. The information about the model name and the errors, that occurred during the series calculation, is displayed in the Memo1 component.
See also: