Selection: IDimSelectionSet;
The Selection property returns selection of the slice used as a data source for a specified cell.
Executing the example requires that the repository contains a regular report with the REPORT identifier that contains a data area linked to the B1 cell. The data slice should contains a dimension with the CALENDAR identifier.
Add links to the Dimensions, Metabase, Report, and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Report: IPrxReport;
Sheet: IPrxSheet;
Drill: IPrxDrillCellResult;
SheetTab: IPrxTable;
Data: IPrxTableDataBinding;
Sel: IDimSelectionSet;
DimSel: IDimSelection;
Begin
MB := MetabaseClass.Active;
// Get regular report
MObj := MB.ItemById("REPORT").Edit;
Report := MObj As IPrxReport;
// Get active report sheet
Sheet := Report.ActiveSheet;
Sheet.Recalc;
SheetTab := Sheet As IPrxTable;
// Get information about B1 cell link to data slice
Data := SheetTab.DataBinding;
Drill := Data.DrillCell(1,1);
// Display the number of elements in selection of the dimension with the CALENDAR identifier in the console
Sel := Drill.Selection;
DimSel := Sel.FindById("CALENDAR");
Debug.WriteLine(DimSel.SelectedCount);
End Sub UserProc;
After executing the example the console displays the number of selected elements of the dimension with the CALENDAR identifier.
See also: