EndUpdate;
The EndUpdate method lifts prohibition from events execution.
After calling the method all events generated in between calling of the IDimSelectionSet.BeginUpdate and IDimSelectionSet.EndUpdate methods.
Executing the example requires that repository contains cube with the CUBE_SEP_PARAMS identifier.
Ad links to the Cubes, Dimensions, Matrix, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
cubeinst: ICubeInstance;
matrix: Imatrix;
matrixds: IMatrixDataSource;
dimselectionset: IDimSelectionSet;
coord: IMatrixCoord;
i: integer;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get cube
cubeinst := mb.ItemById("CUBE_SEP_PARAMS").Open(Null) As ICubeInstance;
// Get target as matrix
matrixds := CubeInst.Destinations.DefaultDestination As IMatrixDataSource;
// Create set of selections for dimensions
dimselectionset := matrixds.CreateDimSelectionSet;
// Disable change
dimselectionset.BeginUpdate;
// Save selection collection in matrix
matrix := matrixds.Execute(dimselectionset);
// Create coordinate in matrix
coord := matrix.CreateCoord;
// Change value for all coordinate elements in dimension
For i := 0 To matrix.DimensionCount - 1 Do
coord.Item(i) := 0;
End For;
// Set new value for coordinate in matrix
matrix.Item(Coord) := 10;
// Save changes in matrix
matrixds.SaveData(matrix);
// Apply changes
dimselectionset.EndUpdate;
End Sub UserProc;
After executing the example matrix will be obtained basing on the cube. For the matrix coordinate value will be changed, after it changed matrix will be saved to the cube.
See also: