Type: PrxSheetType;
Type: Prognoz.Platform.Interop.Report.PrxSheetType;
The Type property returns the sheet type.
To work with a regular report sheet, different interfaces are used depending on its type: IPrxTable for the PrxSheetType.Table value and IPrxDocument for the PrxSheetType.Document value.
Executing the example requires that the repository contains a regular report with the REG_REPORT_TMP identifier.
Add links to the Metabase, Report, Ui system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
Sheet: IPrxSheet;
Sheets: IPrxSheets;
SheetTab: IPrxTable;
i: Integer;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get report
Report := Mb.ItemById("PROC_REPORT_TMP").Edit As IPrxReport;
// Get report sheets
Sheets := Report.Sheets;
// Determine, which sheets are of table type
For i := 0 To Report.Sheets.Count - 1 Do
Sheet := Report.Sheets.Item(i);
If Sheet.Type = PrxSheetType.Table Then
SheetTab := Sheet As IPrxTable;
//Display message
WinApplication.InformationBox("Sheet " + Sheet.Name + " of table type");
End If;
End For;
End Sub UserProc;
After executing the example the message about table sheet existence in the report, containing sheet name, is displayed. The number of displayed messages is equal to the number of report table sheets.
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.Ui;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IPrxReport;
Sheet: IPrxSheet;
SheetTab: IPrxTable;
Sheets: IPrxSheets;
i: Integer;
WinAppCls: WinApplicationClass = New WinApplicationClassClass();
Begin
// Get current repository
MB := Params.Metabase;
// Get report
Report := Mb.ItemById["PROC_REPORT_TMP"].Edit() As IPrxReport;
// Get report sheets
Sheets := Report.Sheets;
// Determine, which sheets are of table type
For i := 0 To Report.Sheets.Count - 1 Do
Sheet := Report.Sheets.Item[i];
If Sheet.Type = PrxSheetType.pstTable Then
SheetTab := Sheet As IPrxTable;
//Display message
WinAppCls.InformationBox("Sheet " + Sheet.Name + " of table type", Null);
End If;
End For;
End Sub;
See also: