CopyElementsData(Selection: IDimSelectionSet; DimKey: Integer; Element: Integer);
Selection. Selection of dimension elements, to which data should be copied.
DimKey. Key of the dimension, by which copying is executed.
Element. Dimension element, which data should be copied by all the elements selected in Selection.
The CopyElementsData method copies automatic cube data according to the specified parameters.
Executing the example requires an automatic cube with the AUTO_CUBE identifier. The cube contains a dimension with the Dim_1 identifier, by which copying is executed.
Sub UserProc;
Var
MB: IMetabase;
CubeInst: ICubeInstance;
DimSS: IDimSelectionSet;
DimS: IDimSelection;
DimKey: Integer;
Begin
MB := MetabaseClass.Active;
CubeInst := MB.ItemById("AUTO_CUBE").Open(Null) As ICubeInstance;
DimSS := CubeInst.Destinations.DefaultDestination.CreateDimSelectionSet;
For Each Dims In DimSS Do
If Dims.Dimension.Ident = "Dim_1" Then
DimS.SelectElement(1, False);
DimS.SelectElement(2, False);
DimKey := Dims.Dimension.Key;
Else
DimS.SelectAll;
End If;
End For;
(CubeInst As IAutoCubeInstance).CopyElementsData(DimSS, DimKey, 0);
End Sub UserProc;
After executing the example data is copied into the automatic cube. The copied data is located by the first element of the specified dimension. Copying is executed to the cells located by the second and third element of the dimension and all the elements of other dimensions.
See also: