Skip to main content

dxPSExportToPDFFile(string,TBasedxReportLink,Boolean,TdxPSPDFReportExportOptions) Method

Exports a specified report link’s report as a PDF document to a file.

Declaration

function dxPSExportToPDFFile(const AFileName: string; AReportLink: TBasedxReportLink; AShowSettingsDialog: Boolean = True; ASettings: TdxPSPDFReportExportOptions = nil): Boolean;

Parameters

Name Type
AFileName string
AReportLink TBasedxReportLink
AShowSettingsDialog Boolean
ASettings TdxPSPDFReportExportOptions

Returns

Type
Boolean

Remarks

Call this global function and pass a path to a destination PDF document file as the AFileName parameter to export the report of a source report link passed as the AReportLink parameter. A dxPSExportToPDFFile function call invokes the “PDF Export Options” and “Save As” dialogs like dxPSExportToPDF does.

The dxPSExportToPDFStream function populates the “PDF Export Options” dialog according to the source report link’s active PDF export settings. You can pass an alternative source of default settings as the ADefaultSettings optional parameter or pass False as the AShowSettingsDialog optional parameter to export the source report without end-user interaction.

The dxPSExportToPDFFile function returns True if one of the following conditions is met:

  • A user closes the “PDF Export Options” or “Save As” dialog without confirmation.

  • A report export operation fails for any reason.

Otherwise – the function returns True.

Note

You can handle the component printer‘s OnBeforeExportToPDF event to cancel the pending PDF export operation under specific circumstances or override its settings before the operation starts.

See Also