DimRange(DimKey: Integer; [LevelIndex: Integer = -1;] [CheckMergedCells: Boolean = false]): ITabRange;
DimRange[DimKey: uinteger; LevelIndex: integer; CheckMergedCells: boolean]: Prognoz.Platform.Interop.Tab.ITabRange;
DimKey. Key of the dimension
LevelIndex. Dimension level.
CheckMergedCells. Indicates whether cells tucking is taken into account.
The DimRange property returns table cell range where elements of the dimension specified by key are shown.
Available values of the CheckMergedCells parameter:
True. Tucking is taken into account.
False. Tucking is not taken into account. Default value.
The CheckMergedCells parameter affects, for example, on dimension priority on formatting table area of data entry form.
Dimension level is ignored if LevelIndex is set to -1.
To return table cells range where totals by columns or rows are displayed, use IEaxGrid.TotalsRange.
Executing the example requires an express report with the EXPRESS identifier that contains a table with totals by columns. One of the dimensions, which is used to build a table is a calendar dimension with the 10127 key.
Add links to the Express, Metabase, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Analyzer: IEaxAnalyzer;
Grid: IEaxGrid;
DimRange, TotalsRange: ITabRange;
Begin
MB := MetabaseClass.Active;
Analyzer := MB.ItemById("EXPRESS").Bind As IEaxAnalyzer;
Grid := Analyzer.Grid;
DimRange := Grid.DimRange(10127, -1, False);
Debug.WriteLine
("Address of cells range where dimension elements are displayed - " + DimRange.Address);
TotalsRange := Grid.TotalsRange(True);
Debug.WriteLine
("Address of cells range where totals by columns are displayed - " + TotalsRange.Address);
End Sub UserProc;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Analyzer: IEaxAnalyzer;
Grid: IEaxGrid;
DimRange, TotalsRange: ITabRange;
Begin
MB := Params.Metabase;
Analyzer := MB.ItemById["EXPRESS"].Bind() As IEaxAnalyzer;
Grid := Analyzer.Grid;
DimRange := Grid.DimRange[10127, -1, False];
System.Diagnostics.Debug.WriteLine
("Address of cells range where dimension elements are displayed - " + DimRange.Address);
TotalsRange := Grid.TotalsRange[True];
System.Diagnostics.Debug.WriteLine
("Address of cells range where totals by columns are displayed - " + TotalsRange.Address);
End Sub;
After executing the example the console displays addresses of cells ranges where the following is displayed:
Dimension elements.
Totals by columns.
See also: