Add(Value: IDimSelectionSet);
Value. Added selection.
The Add method adds the specified selection to the object selection.
To get the selection corresponding to the selected area, use the IEaxObjectSelection.Item property.
Executing the example requires that the repository contains an express report with the EAX_SEL_MANAGER identifier.
Add links to the Dimensions, Express, Metabase, Pivot system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Report: IEaxAnalyzer;
SelManager: IEaxObjectSelectionManager;
ObjSel: IEaxObjectSelection;
PivotDims: IPivotDimensions;
SelFactory: IDimSelectionSetFactory;
SelSet: IDimSelectionSet;
i: Integer;
Sel: IDimSelection;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get express report
Report := mb.ItemById("EAX_SEL_MANAGER").Edit As IEaxAnalyzer;
// Get object to work with selection, by which data table is built
SelManager := Report.Grid.SelectionManager;
// Get table selection
ObjSel := SelManager.Selection;
// Get dimensions used to build table
PivotDims := Report.Pivot.Dimensions;
// Create collection of selections
SelFactory := New DimSelectionSetFactory.Create;
SelSet := SelFactory.CreateDimSelectionSet;
For i := 0 To PivotDims.Count - 1 Do
Sel := SelSet.Add(PivotDims.Item(i).DimInstance);
Sel.SelectElement(1, False);
End For;
// Add custom selection to table selections
ObjSel.Add(SelSet);
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the table selection corresponding to the selected areas will be added.
See also: