RebuildCompounds;
The RebuildCompounds method rebuilds composite dimensions in table.
The method is available during locking changes in selection and rerendering table. It is used on application of controlling dimension settings in cube and advanced filter. The method is used if after changing selection in the common parent dimension it is required to reopen the dictionary in the child dimension.
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 the sidehead, the controlled dimension is in indicator's private dimensions. The controlling dimension has the DIM identifier, the controlled dimension has the DIM_1 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;
dataarea: IEaxDataArea;
grid: IEaxGrid;
version_index: integer;
selComp, sel, selCarr: IDimSelection;
Begin
//Stop rebuilding analytical data area
dataarea := report.DataArea;
dataarea.BeginUpdate;
//Get table area
grid := dataarea.Views.FindById("AREA1") As IEaxGrid;
// Get table base
pivot := grid.Pivot;
// Stops rebuilding of table and selection
pivot.BeginUpdate;
pivot.BeginSelectionUpdate;
// Get controlling dimension selection
sel := pivot.Selection.FindById("DIM");
// Deselect elements
sel.DeselectAll;
// Add an element to selection
version_index := 0;
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_1");
// Resume rebuilding selection, table and analytical data area
pivot.EndSelectionUpdate;
pivot.EndUpdate;
dataarea.EndUpdate;
End Sub RebuildCompounds;
After executing the example, clicking the custom button rebuilds the data entry form's table area.
See also: