Id: String;
Id: string;
The Id property determines object identifier.
As identifier characters only Latin characters, numbers and the _ underscore can be used.
Executing the example requires that the repository contains a regular report with the REG_REPORT identifier. The report contains analytical data area.
Add links to the Express, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
PivSlice: IEaxDataAreaSlice;
GridObject: IEaxObject;
Grid: IEaxGrid;
Tab: IPrxTable;
Sheet: ITabSheet;
Range: ITabRange;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Rep := MB.ItemById("REG_REPORT").Edit As IPrxReport;
// Get analytical data area slice
PivSlice := Rep.DataArea.Slices.Item(0);
// Create copy of data slice
PivSlice.Copy(EaxSliceCopyOptions.All);
// Get object to work with table
GridObject := PivSlice.Views.Item(0) As IEaxObject;
// Change object identifier
If GridObject.Id.IsEmpty Then
GridObject.Id := "GridTab";
End If;
// Disable data saving to the source
GridObject.AllowSaveData := False;
// Create table copy
Grid := PivSlice.Views.Item(0) As IEaxGrid;
Tab := Rep.Sheets.Item(0) As IPrxTable;
Sheet := Tab.TabSheet;
Range := Sheet.ParseRange("A0:H6");
Grid.Copy(Sheet, Range);
// Save changes in express report
(Rep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example:
Identifier of analytical data area will change.
Data on table change will not be saved to the source.
Copies of table and analytical data area slice will be created.
The requirements and result of the Fore.NET Example match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Rep: IPrxReport;
PivSlice: IEaxDataAreaSlice;
GridObject: IEaxObject;
Grid: IEaxGrid;
Tab: IPrxTable;
Sheet: TabSheet;
Range: ITabRange;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Rep := MB.ItemById["REG_REPORT"].Edit() As IPrxReport;
// Get analytical data area slice
PivSlice := Rep.DataArea.Slices.Item[0];
// Create copy of data slice
PivSlice.Copy(EaxSliceCopyOptions.escoAll);
// Get object to work with table
GridObject := PivSlice.Views.Item[0] As IEaxObject;
// Change object identifier
If GridObject.Id.IsEmpty Then
GridObject.Id := "GridTab";
End If;
// Disable data saving to the source
GridObject.AllowSaveData := False;
// Create table copy
Grid := PivSlice.Views.Item[0] As IEaxGrid;
Tab := Rep.Sheets.Item[0] As IPrxTable;
Sheet := Tab.TabSheet;
Range := Sheet.ParseRange("A0:H6");
Grid.Copy(Sheet, Range);
// Save changes in express report
(Rep As IMetabaseObject).Save();
End Sub;
See also: