Skip to main content

TdxPrintDialog Class

A non-visual component designed to display a custom Print dialog.

Declaration

TdxPrintDialog = class(
    TcxCustomComponent
)

Remarks

Use the TdxPrintDialog component only if you need to implement custom behavior for the standard Print dialog.

VCL Printing System: A Print Dialog Example

Important

The TdxPrintDialog component does not affect the built-in Print dialog available for the TdxComponentPrinter component and control-specific report links.

Main API Members

The list below outlines key members of the TdxPrintDialog class that allow you to configure and display the Print dialog.

Printer Settings

Collate
Specifies if the page collate option is enabled.
Copies
Specifies the number of printed copies.
MinRange | MaxRange
Specify the target range of printed pages.
OptionsEnabled
Specifies active Boolean printer options (print to file, all pages, current page, etc.).
OptionsVisible
Specifies visible UI elements.
PageCount | PageNums | PageRanges | Pages
Specify page range-related settings for the Print dialog.
PrintToFile
Specifies if the target document is printed to a file.
Execute

Displays the Print dialog using the current settings.

This function returns True if a user clicks the Print button to close the dialog.

OnClose
Allows you to respond to Print dialog close operations.
OnPageSetup

Allows you to respond to clicks on the Page Setup… button.

Handle this event to implement Page Setup dialog functionality. If OnPageSetup is unhandled, the Page Setup… button is disabled in the Print dialog.

OnShow
Allows you to execute custom code before the Print dialog appears (following an Execute function call).

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