Copy([Sheet: IPrxSheet = Null], [Range: IPrxRange]): IPrxDataIsland;
Copy([Sheet: Prognoz.Platform.Interop.Report.IPrxSheet = Null], [Range: Prognoz.Platform.Interop.Report.IPrxRange]): Prognoz.Platform.Interop.Report.IPrxDataIsland;
Sheet. Regular report sheet, to which the data area is copied.
Range. A cell or a cell range, to which the data area is copied.
The Copy method copies a data area.
Executing the example requires a regular report with the REPORT identifier, which contains data area and two sheets. 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;
Table: ITabSheet;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("REPORT").Edit;
Report := MObj As IPrxReport;
DI := Report.DataIslands.Item(0);
// Set a cell and copy the data area.
Sheets := Report.Sheets;
Sheet := Sheets.Item(Report.Sheets.Count-1);
Table := Sheet.Table;
Range := Table.Cell(20,5);
DI.Copy(Sheet,Range);
// Save report
MObj.Save;
End Sub UserProc;
After executing the example the first data area is copied to the last sheet of the regular report to the cell F20.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Metabase;
Public Class StartParams
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObject;
DI: IPrxDataIsland;
Range: ITabRange;
Report: IPrxReport;
Sheets: IPrxSheets;
Sheet: IPrxSheet;
Table: ITabSheet;
Begin
MB := Params.Metabase;
MObj := MB.ItemById["REPORT"].Edit();
Report := MObj As IPrxReport;
DI := Report.DataIslands.Item[0];
// Set a cell and copy the data area.
Sheets := Report.Sheets;
Sheet := Sheets.Item[Report.Sheets.Count-1];
Table := Sheet.Table;
Range := Table.Cell[20,5];
DI.Copy(Sheet,Range);
// Save report
MObj.Save();
End Sub;
See also: