Range: ITabRange;
Range: Prognoz.Platform.Interop.Tab.ITabRange;
The Range property returns range of the table rectangular area.
To determine parameters of table rectangular area, use IEaxGrid.OutPutRect.
Executing the example requires that the repository contains regular report with the REPORT identifier containing analytical data area.
Add links to the Drawing, Express, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
PivSlice: IEaxDataAreaSlice;
Grid: IEaxGrid;
NOutputRect, OutputRect: IGxRect;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get regular report
Report := MB.ItemById("REPORT").Edit As IPrxReport;
// Get table
PivSlice := Report.DataArea.Slices.Item(0);
Grid := PivSlice.Views.Item(0) As IEaxGrid;
// Display to the console table cells range address
Report.Recalc;
Debug.WriteLine("Table cells range - " + Grid.Range.Address);
// Get table parameters
OutputRect := Grid.OutputRect;
// Create new table area
NOutputRect := New GxRect.CreateFromRect(OutputRect);
NOutputRect.Bottom := OutputRect.Bottom + 1;
NOutputRect.Left := OutputRect.Left + 1;
NOutputRect.Right := OutputRect.Right + 1;
NOutputRect.Top := OutputRect.Top + 1;
// Set new area for the table
Grid.OutputRect := NOutputRect;
// Refresh report
Grid.Refresh;
Report.Recalc;
// Display to the console address of cells range of a new table area
Debug.WriteLine("Address of cells range of a new table area - " + Grid.Range.Address);
// Save changes
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example:
In regular report of the table it moves on one cell to the right and to the button.
The console displays addresses of table cells ranges before new area settings and after it.
The requirements and result of Fore.NET Example execution is the same as in the Fore Example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IPrxReport;
PivSlice: IEaxDataAreaSlice;
Grid: IEaxGrid;
NOutputRect, OutputRect: GxRect;
Rect: GxRect = New GxRectClass();
Begin
// Get repository
MB := Params.Metabase;
// Get regular report
Report := MB.ItemById["REPORT"].Edit() As IPrxReport;
// Get table
PivSlice := Report.DataArea.Slices.Item[0];
Grid := PivSlice.Views.Item[0] As IEaxGrid;
// Display to the console table cells range address
Report.Recalc();
System.Diagnostics.Debug.WriteLine("Table cells range - " + Grid.Range.Address);
// Get table parameters
OutputRect := Grid.OutputRect;
// Create new table area
Rect.CreateFromRect(OutputRect);
NOutputRect := Rect;
NOutputRect.Bottom := OutputRect.Bottom + 1;
NOutputRect.Left := OutputRect.Left + 1;
NOutputRect.Right := OutputRect.Right + 1;
NOutputRect.Top := OutputRect.Top + 1;
// Set new area for the table
Grid.OutputRect := NOutputRect;
// Refresh report
Grid.Refresh();
Report.Recalc();
// Display to the console address of cells range of a new table area
System.Diagnostics.Debug.WriteLine("Address of cells range of a new table area - " + Grid.Range.Address);
// Save changes
(Report As IMetabaseObject).Save();
End Sub;
See also: