Selection([Update: Boolean = True]): IEaxObjectSelection;
Selection[Update: boolean]: Prognoz.Platform.Interop.Express.IEaxObjectSelection;
Update. Attribute that selection will be changed.
The Selection property returns object selection.
Object selection is used to get dimension selection corresponding to the selection of areas in the object.
Available Values of the Update parameter:
True. Selection will be changed.
False. Selection will not be changed.
Executing the example requires that repository contains express report with the EAX_SEL_MANAGER identifier. This report should contain the table with several selected areas.
Add links to the Dimensions, Express, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Report: IEaxAnalyzer;
SelManager: IEaxObjectSelectionManager;
ObjSel: IEaxObjectSelection;
i, j: Integer;
SelSet: IDimSelectionSet;
Sel: IDimSelection;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get express report
Report := mb.ItemById("EAX_SEL_MANAGER").Bind As IEaxAnalyzer;
// Get object to work with selection used to build data table
SelManager := Report.Grid.SelectionManager;
// Get selection in the table
ObjSel := SelManager.Selection;
If ObjSel.Count > 0 Then
// Display selection corresponding to areas selected in the table
For i := 0 To ObjSel.Count - 1 Do
Debug.WriteLine("Selection set " + (i + 1).ToString);
Debug.Indent;
SelSet := ObjSel.Item(i);
For j := 0 To SelSet.Count - 1 Do
Sel := SelSet.Item(j);
Debug.WriteLine("Dimension selections '" + Sel.Dimension.Name + "'");
Debug.Indent;
Debug.WriteLine(Sel.ToString);
Debug.Unindent;
End For;
Debug.Unindent;
Debug.WriteLine("");
End For;
// Display spliced selection corresponding to all areas selected in the table
Debug.WriteLine("Spliced set of selections");
Debug.Indent;
SelSet := ObjSel.Combined;
For j := 0 To SelSet.Count - 1 Do
Sel := SelSet.Item(j);
Debug.WriteLine("Dimension selection '" + Sel.Dimension.Name + "'");
Debug.Indent;
Debug.WriteLine(Sel.ToString);
Debug.Unindent;
End For;
Debug.Unindent;
End If;
End Sub UserProc;
After executing the example, the console window displays selection corresponding to each selected area in the table and selection corresponding to all selected areas in the table.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Report: IEaxAnalyzer;
SelManager: IEaxObjectSelectionManager;
ObjSel: IEaxObjectSelection;
i, j: Integer;
SelSet: IDimSelectionSet;
Sel: IDimSelection;
Begin
// Get current repository
mb := Params.Metabase;
// Get express report
Report := mb.ItemById["EAX_SEL_MANAGER"].Bind() As IEaxAnalyzer;
// Get object to work with selection used to build data table
SelManager := Report.Grid.SelectionManager;
// Get selection in the table
ObjSel := SelManager.Selection[True];
If ObjSel.Count > 0 Then
// Display selection corresponding to areas selected in the table
For i := 0 To ObjSel.Count - 1 Do
System.Diagnostics.Debug.WriteLine("Set of selections " + (i + 1).ToString());
System.Diagnostics.Debug.Indent();
SelSet := ObjSel.Item[i];
For j := 0 To SelSet.Count - 1 Do
Sel := SelSet.Item[j];
System.Diagnostics.Debug.WriteLine("Dimension selection '" + Sel.Dimension.Name + "'");
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine(Sel.ToString("", ",", False));
System.Diagnostics.Debug.Unindent();
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("");
End For;
// Display spliced selection corresponding to all areas selected in the table
System.Diagnostics.Debug.WriteLine("Spliced set of selections");
System.Diagnostics.Debug.Indent();
SelSet := ObjSel.Combined;
For j := 0 To SelSet.Count - 1 Do
Sel := SelSet.Item[j];
System.Diagnostics.Debug.WriteLine("Dimension selection '" + Sel.Dimension.Name + "'");
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine(Sel.ToString("", ",", False));
System.Diagnostics.Debug.Unindent();
End For;
System.Diagnostics.Debug.Unindent();
End If;
End Sub;
See also: