ExportRange: String;
ExportRange: string;
The ExportRange property determines the range of the sheets to be exported.
The range of exported sheets is specified as sheet numbers and/or sheet ranges separated with commas. For example: "1, 3-6".
On exporting a regular report to PNG format the range of exported sheets is specified in the format: X:Y. Where:
X - number of printed page on report sheet (numbering starts with 1).
Y - number of report sheet (numbering starts with 0).
That is, if the range is 4:0, the fourth printed page on the first report sheet is exported.
To set one exported sheet, use the IPrxReportExporter.Sheet property.
Executing the example requires a regular report with the REGULAR_REPORT identifier in the object navigator.
Add links to the Metabase, Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
Exp: IPrxReportExporter;
Begin
MB := MetabaseClass.Active;
Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
Exp := New PrxReportExporter.Create;
Exp.Report := Report;
Exp.ExportSheetTitles := True;
Exp.ExportRange := "4:0";
Exp.ExportToFile("C:\" + Report.Name + ".png", "png");
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example regular report is exported to PNG file. The output file will contain sheet names.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IPrxReport;
Exp: IPrxReportExporter;
Begin
MB := Params.Metabase;
Report := MB.ItemById["REPORT_CHART"].Edit() As IPrxReport;
Exp := New PrxReportExporter.Create();
Exp.Report := Report;
Exp.ExportSheetTitles := True;
Exp.ExportRange := "4:0";
Exp.ExportToFile("C:\" + Report.Name + ".png", "png");
(Report As IMetabaseObject).Save();
End Sub;
See also: