RebuildCompounds;
RebuildCompounds();
The RebuildCompounds method rebuilds composite dimensions.
The method is available during locking changes in selection and rerendering table. It is used on applying controlling dimension settings in cube and advanced filter.
Executing the example requires that the repository contains a data entry form with a table area with the AREA1 identifier, for which a cube with configured controlling dimension is set as an indicator. The controlling dimension is in shared dimensions, the controlled dimension is in indicator's private dimensions. The controlled dimension has the DIM identifier.
The unit is connected as a custom button to a data entry form.
Add links to the Dimensions, Express, Pivot, Report system assemblies.
Public Sub RebuildCompounds(report: IPrxReport);
Var
pivot: IPivot;
grid: IEaxGrid;
version_index: integer;
selComp, sel, selCarr: IDimSelection;
Begin
//Get table area
grid := report.DataArea.Views.FindById("AREA1") As IEaxGrid;
// Get table base
pivot := grid.Pivot;
// Stops rebuilding of table and selection
pivot.BeginUpdate;
pivot.BeginSelectionUpdate;
// Get composite dimension selection
selComp := pivot.Selection.FindById("FACTS_COMPOUND");
sel := ((selComp As ICompoundSelection).Selection.Item(0) As ICompoundSelection).Selection.FindById("DIM");
// Deselect elements
sel.DeselectAll;
// Add an element to selection
version_index := 3;
sel.SelectElement(version_index, False);
// Rebuild composite dimension
pivot.RebuildCompounds;
// Get composite dimension selection again
selComp := pivot.Selection.FindById("FACTS_COMPOUND");
selCarr := ((selComp As ICompoundSelection).Selection.Item(0) As ICompoundSelection).Selection.FindById("DIM");
// Resume rebuilding of selection and table
pivot.EndSelectionUpdate;
pivot.EndUpdate;
End Sub RebuildCompounds;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;
Imports Prognoz.Platform.Interop.Report;
…
Public Class Module
Public Sub RebuildCompounds(report: IPrxReport);
Var
pivot: IPivot;
grid: IEaxGrid;
version_index: uinteger;
selComp, sel, selCarr: IDimSelection;
Begin
//Get table area
grid := report.DataArea.Views.FindById("AREA1") As IEaxGrid;
// Get table base
pivot := grid.Pivot;
// Stops rebuilding of table and selection
pivot.BeginUpdate();
pivot.BeginSelectionUpdate();
// Get composite dimension selection
selComp := pivot.Selection.FindById("FACTS_COMPOUND");
sel := ((selComp As ICompoundSelection).Selection.Item[0] As ICompoundSelection).Selection.FindById("DIM");
// Deselect elements
sel.DeselectAll();
// Add an element to selection
version_index := 3;
sel.SelectElement(version_index, False);
// Rebuild composite dimension
pivot.RebuildCompounds();
// Get composite dimension selection again
selComp := pivot.Selection.FindById("FACTS_COMPOUND");
selCarr := ((selComp As ICompoundSelection).Selection.Item[0] As ICompoundSelection).Selection.FindById("DIM");
// Resume rebuilding of selection and table
pivot.EndSelectionUpdate();
pivot.EndUpdate();
End Sub RebuildCompounds;
End Class;
After executing the example, clicking the custom button rebuilds the data entry form's table area.
See also: