IPrxReport.MoveSelectedGridToSheet

Syntax

MoveSelectedGridToSheet(Value: String);

Parameters

Value. Name of the sheet, to which the selected data area is moved.

Description

The MoveSelectedGridToSheet method moves the selected data area table to another sheet.

Comments

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.

Example

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(0As 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:

IPrxReport