MoveSelectedGridToSheet(Value: String);
Value. Name of the sheet, to which the selected data area is moved.
The MoveSelectedGridToSheet method moves the selected data area table to another sheet.
The sheet, on which the moved data area table is placed, should be active. After the table is moved, it is recommended to recalculate the report using Recalc/RecalcC method.
Executing the example requires that the repository contains a regular report with the REPORT identifier. A source is added in the report, based on which a data area is created on the active sheet. The report contains at least two sheets with default names.
Add links to the Express, Metabase, Report and Tab system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Report: IPrxReport;
ViewRange: ITabRange;
Tab: ITabSheet;
Begin
Mb := MetabaseClass.Active;
Report := Mb.ItemById("OBJ347911").Edit As IPrxReport;
// Data area table range
ViewRange := (Report.DataArea.Views.Item(0) As IEaxGrid).Range;
// Select table area
Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
Tab.View.Selection.Range := ViewRange;
// Move to another sheet
Report.MoveSelectedGridToSheet("Sheet2");
Report.ActiveSheet := Report.Sheets.FindByName("Sheet2");
Report.Recalc;
// Save changes
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the data area table is moved from the first report sheet to the second report sheet.
See also: