Add(Slice: IEaxDataAreaSlice;
DS: IDimSelection;
Key: Integer;
[ElementsToCopy: IDimSelection = Null]): IEaxDataAreaHierarchy;
Add(Slice: Prognoz.Platform.Interop.Express.IEaxDataAreaSlice;
DS: Prognoz.Platform.Interop.Dimensions.IDimSelection;
Key: uinteger;
ElementsToCopy: Prognoz.Platform.Interop.Dimensions.IDimSelection):
Prognoz.Platform.Interop.Express.IEaxDataAreaHierarchy;
Slice. Analytical data area slice.
DS. Dimension selection.
Key. Dimension key.
ElementsToCopy. Selection where elements of current selection will be added. Optional parameter, to ignore use Null.
The Add method adds new alternative hierarchy in collections.
To clear collection of alternative hierarchies, use IEaxDataAreaHierarchies.Clear or IEaxDataAreaHierarchies.ClearAll.
Executing the example requires that the repository contains an express report with the EXPRESS identifier containing table.
Add links to the Dimensions, Express, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
DimSel: IDimSelection;
Hiers: IEaxDataAreaHierarchies;
Hier: IEaxDataAreaHierarchy;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get data source slice
DArea := Express.DataArea;
Slice := DArea.Slices.Item(0);
//Get dimension selection
DimSel := Slice.Selection.Item(0);
// Create new alternative hierarchy of analytical data area
Hiers := DArea.Hierarchies;
Hier := Hiers.Add(Slice, DimSel, DimSel.Dimension.Key);
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example alternative hierarchy is created in express report.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
DimSel: IDimSelection;
Hiers: IEaxDataAreaHierarchies;
Hier: IEaxDataAreaHierarchy;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get data source slice
DArea := Express.DataArea;
Slice := DArea.Slices.Item[0];
//Get dimension selection
DimSel := Slice.Selection.Item[0];
// Create new alternative hierarchy of analytical data area
Hiers := DArea.Hierarchies;
Hier := Hiers.Add(Slice, DimSel, DimSel.Dimension.Key, Null);
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
See also: