AddGroupSerie(
Rubricator: IRubricator;
MetaAttributeValues: ILanerMetaAttributeValueList;
[RevisionKey: Integer = -1;]
[Index: Integer = -1]
): ILanerGroupSerie;
Rubricator. Time series database.
MetaAttributeValues. Attributes set.
RevisionKey. The key of the revision, which data needs to be displayed.
Index. Index of the position, to which it is required to add the group of series.
The AddGroupSerie method adds a series group.
The group is formed from the series that correspond to the set of attributes determined by the MetaAttributeValues parameter.
If the RevisionKey parameter has the -1 value, data for the last revision is displayed.
If the time series database is a non-version one, the value of the RevisionKey parameter is ignored. The indicator of whether time series database is versional is returned by the IRubricator.KeepHistory property.
If the Index parameter has the value -1, the series group is added to the end of the series collection.
Executing the example requires a workbook with the WORKBOOK_SERIES identifier that contains several series. The time series database that contains a mandatory series attribute with the INDICATOR identifier must be used as a data source for the workbook.
Add links to the Cubes, Express, Laner, Metabase, Rds system assemblies.
Sub UserProc;
Var
mb: IMetabase;
WbkObj: IMetabaseObject;
EaxAn: IEaxAnalyzer;
Laner: ILaner;
Series: ILanerSeries;
Rub: IRubricator;
MetaAtt: IMetaAttribute;
AttrVals: ILanerMetaAttributeValues;
AttrVal: ILanerMetaAttributeValue;
GroupSer: ILanerGroupSerie;
Begin
// Get workbook
mb := MetabaseClass.Active;
WbkObj := mb.ItemById("WORKBOOK_SERIES").Edit;
EaxAn := WbkObj As IEaxAnalyzer;
Laner := EaxAn.Laner;
// Get workbook series
Series := Laner.Series;
// Get the time series database that is a data source for the workbook
Rub := Laner.RubricatorInstance.Rubricator;
// Create collection of attribute values
AttrVals := Series.CreateMetaAttributeValues;
// Get series attribute with the INDICATOR identifier
MetaAtt := Rub.Facts.Attributes.FindById("INDICATOR");
// Add the attribute to the collection
AttrVal := AttrVals.Add(MetaAtt);
// Set attribute value
AttrVal.Value := 765;
// Add a series group to the beginning of the workbook
GroupSer := Series.AddGroupSerie(Rub, AttrVals, -1, 1);
// Open the group
GroupSer.Expanded := True;
// Save changes
WbkObj.Save;
End Sub UserProc;
After executing the example a new group of series is added to the workbook. This group includes the series, in which the INDICATOR attribute value is 765. The group is expanded and located after the first workbook series.
See also: