Skip to main content

TBasedxReportLink.Print(Boolean,PdxPrintDlgData) Method

Prints the report link’s report on the default printer.

Declaration

function Print(AShowDialog: Boolean; APrintDialogData: PdxPrintDlgData): Boolean; overload;

Parameters

Name Type
AShowDialog Boolean
APrintDialogData PdxPrintDlgData

Returns

Type
Boolean

Remarks

Pass True as the AShowDialog parameter to invoke the Print dialog, allowing end-users to customize print settings (such as the required number of copies, printed page ranges, collation flag, etc.)

Pass a pointer to a TdxPrintDialogData object that contains custom print settings as the APrintDialogData parameter to print the report using these settings or initialize the Print dialog (if invoked) with them.

The first overloaded variant calls the second overloaded variant and passes AShowDialog and nil as parameters. The first overloaded variant is called internally by the PageSetup function if an end-user clicks the Print… button in the Page Setup dialog.

The second overloaded variant requires a component printer associated with the report link. If it’s not associated (the ComponentPrinter property returns nil), this variant returns False. Otherwise, the variant does the following:

  • Makes this report link active by setting its IsCurrentLink property to True;

  • Calls the component printer’s Print function, passes AShowDialog, APrintDialogData, and the report link as parameters to the function, and returns its result.

Normally, the second overloaded variant is used internally. To print a report with custom print settings, call the PrintEx, PrintPages, or PrintPagesEx procedure instead.

The Print function returns True if the report is successfully added to the printer job queue; otherwise, False. For instance, False is returned when an end-user cancels printing the report by closing the Print dialog by any method other than clicking the Print button.

See Also