Skip to main content

TdxPrintDialog.Execute Method

Displays the Print dialog.

Declaration

function Execute: Boolean;

Returns

Type Description
Boolean
True

If a user closed the Print dialog and confirmed pending changes.

Tip

A click on the Print button within the displayed dialog has no predefined effect. Call custom print-related commands in your code if the Execute function returns True (as demonstrated in the code example below).

False
If a user closed the Print dialog and discarded pending changes.

Remarks

Call the Execute function to display the custom Print dialog.

VCL Printing System: A Print Dialog Example

Unlike the Print dialog available for the TdxComponentPrinter component, the displayed Print dialog has no built-in print functionality. For example, the Page Setup… button is disabled if the OnPageSetup event is not handled.

Code Example: Display the Print Dialog and Print Content

The following code example displays the Print dialog and prints control content using the current report link:

uses
  dxPSCore,  // Declares the TdxComponentPrinter class
  dxPrnDlg;  // Declares the TdxPrintDialog component
// ...

procedure TMyForm.dxSpreadSheetShowPrintFormExecute(Sender: TObject);
begin
  if dxPrintDialog1.Execute() then  // Displays the Print dialog
    dxComponentPrinter1.Print(False, nil);  // Prints content using the current report link
end;
See Also