IPrxDataIsland.Copy

Syntax

Copy([Sheet: IPrxSheet = Null], [Range: IPrxRange]): IPrxDataIsland;

Description

The Copy method copies a data area.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier that contains two sheets. The first sheet should contain a data area.

Add links to the Metabase, Report, Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    DI: IPrxDataIsland;
    Range: ITabRange;
    Report: IPrxReport;
    Sheets: IPrxSheets;
    Sheet: IPrxSheet;
    SheetTab: IPrxTable;
    Table: ITabSheet;
Begin
    MB := MetabaseClass.Active;
    // Get regular report
    MObj := MB.ItemById("REPORT").Edit;
    Report := MObj As IPrxReport;
    DI := Report.DataIslands.Item(0);
    // Set cell and copy data area from the first sheet to the second sheet
    Sheets := Report.Sheets;
    Sheet := Sheets.Item(Report.Sheets.Count-1);    
    SheetTab := Sheet As IPrxTable;
    Table := SheetTab.TabSheet;
    Range := Table.Cell(20,5);
    DI.Copy(Sheet,Range);
    // Refresh report
    Report.Recalc;
    // Save changes
    MObj.Save;
End Sub UserProc;

After executing the example, the data era from the first sheet is copied to the F20 cell of the second sheet of the regular report.

See also:

IPrxDataIsland