Apply: Boolean;
The Apply method creates a cube selection in the specified mode.
Executing the example requires that the repository contains a cube with the CUBE_SEP identifier.
Sub UserProc;
Var
MB: IMetabase;
Cube: ICubeModel;
CubeInst: ICubeInstance;
Ap: ICubeSelectionControlApply;
Se: IDimSelection;
Begin
MB := MetabaseClass.Active;
Cube := MB.ItemById("CUBE_SEP").Bind As ICubeModel;
CubeInst := (Cube As IMetabaseObject).Open(Null) As ICubeInstance;
//Mode of sorting the list of dimensions
Ap := Cube.SelectionControl.CreateApply(SelectionControlApplyMode.Sort);
Ap.SourceSelection := CubeInst.Destinations.DefaultDestination.CreateDimSelectionSet;
Debug.WriteLine("---Source list---");
For Each Se In Ap.SourceSelection Do
Debug.WriteLine(Se.Dimension.Name);
End For;
Ap.Apply;
Debug.WriteLine("---List after sorting---");
For Each Se In Ap.ResultSelection Do
Debug.WriteLine(Se.Dimension.Name);
End For;
End Sub UserProc;
On executing the example the object that controls cube selection is created. Control is executed in the sorting mode. The development environment console displays source list and output list of dimensions that contains controlling and then controlled cube dimensions are displayed.
See also:
ICubeSelectionControlApply | ICubeSelectionControl.CreateApply | SelectionControlApplyMode