ExportObjectAsBitmap: Boolean;
ExportObjectAsBitmap: Boolean;
The ExportObjectAsBitmap property determines whether report objects will be exported in PDF as an image or a metafile.
Available values:
True. The object is exported as an image.
False. Default value. The object is exported as a metafile.
Executing the example requires that the repository contains a dashboard with the ADHOC identifier.
Add links to the Adhoc, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IAdhocReport;
Exporter: IAdhocReportExporter;
Begin
MB := MetabaseClass.Active;
// Get dashboard
Report := MB.ItemById("ADHOC").Bind As IAdhocReport;
// Create an export object
Exporter := New AdhocReportExporter.Create;
Exporter.AdhocReport := Report;
// Run export
// Footnote export
Exporter.ExportFootnotes := True;
// Objects as images
Exporter.ExportObjectAsBitmap := True;
Exporter.ExportToFile("C:\Adhoc(ObjectImage).pdf", "pdf");
// Objects as metafiles
Exporter.ExportObjectAsBitmap := False;
Exporter.ExportToFile("C:\Adhoc(ObjectMetafile).pdf", "pdf");
End Sub UserProc;
After executing the example the contents of the dashboard will be exported to two PDF files. In one of them, report objects are shown as images, in another - as metafiles. Footnotes are also exported.
Imports Prognoz.Platform.Interop.AdHoc;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IAdhocReport;
Exporter: IAdhocReportExporter = New AdhocReportExporterClass();
Begin
MB := Params.Metabase;
// Get dashboard
Report := MB.ItemById["ADHOC"].Bind() As IAdhocReport;
// Create an export object
Exporter.AdhocReport := Report;
// Run export
// Footnote export
Exporter.ExportFootnotes := True;
// Objects as images
Exporter.ExportObjectAsBitmap := True;
Exporter.ExportToFile("C:\Adhoc(ObjectImage).pdf", "pdf");
// Objects as metafiles
Exporter.ExportObjectAsBitmap := False;
Exporter.ExportToFile("C:\Adhoc(ObjectMetafile).pdf", "pdf");
End Sub;
See also: