AddEx([SourceKey: Integer = -1;][CopyAggr: Boolean = True]): IStandardCubeDestination;
AddEx(SourceKey: UInteger; CopyAggr: Boolean): Prognoz.Platform.Interop.Cubes.IStandardCubeDestination;
SourceKey. Key of the display version, from which settings are copied.
CopyAggr. Indicates whether aggregation settings are copied.
The AddEx method adds a new cube display version with copying settings from the existing cube display version.
Settings are copied from the display version with the SourceKey key. If the SourceKey parameter is not specified or is equal to -1, settings are copied from the default display version.
If it not required to copy aggregation settings, set the CopyAggr parameter to False.
Executing the example requires a standard cube with the STD_CUBE identifier. Another display version is created in the cube, along with the default display version.
Add links to the Cubes and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Cube: IStandardCube;
Dests: IStandardCubeDestinations;
Dest: IStandardCubeDestination;
Begin
Mb := MetabaseClass.Active;
Cube := Mb.ItemById("STD_CUBE").Edit As IStandardCube;
Dests := Cube.Destinations;
Dest := Dests.Item(1);
Dests.AddEx(Dest.Key, False);
(Cube As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Cube: IStandardCube;
Dests: IStandardCubeDestinations;
Dest: IStandardCubeDestination;
Begin
Mb := Params.Metabase;
Cube := Mb.ItemById["STD_CUBE"].Edit() As IStandardCube;
Dests := Cube.Destinations;
Dest := Dests.Item[1];
Dests.AddEx(Dest.Key, False);
(Cube As IMetabaseObject).Save();
End Sub;
After executing the example, a new display version is created in the cube, setting are copied from the specified display version. Aggregation settings are not copied.
See also: