CreateApply(Mode: SelectionControlApplyMode): ICubeSelectionControlApply;
Mode. Parameter that determines the mode, in which the Apply method is executed.
The CreateApply method creates an object that is used for cube parameters control based on the selection in dimensions.
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;
After executing the example an object that controls cube parameters using the selection is created. This object is executed in the sorting mode. A source list and output list of dimensions that contains controlling and then controlled cube dimensions are displayed.
See also: