Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XtraReportPreviewExtensions.PrintDialog(IReport) Method

Runs the Print dialog to select a printer, specify the print options and print the document.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraPrinting.v24.2.dll

NuGet Package: DevExpress.Win.Printing

#Declaration

public static DialogResult PrintDialog(
    this IReport report
)

#Parameters

Name Type Description
report IReport

An object implementing the IReport interface.

#Returns

Type Description
DialogResult

A DialogResult enumeration value.

#Remarks

Call the PrintDialog method to invoke the Print dialog shown below.

custom-print-dialog

To be able to use this method, you should add the DevExpress.XtraPrinting.v24.2.dll to your project’s References list.

using DevExpress.XtraReports.UI;
// ...

XtraReport1 report = new XtraReport1();
report.PrintDialog();

The PrintDialog internally calls the Link.CreateDocument method if a document has not been created before opening the Print dialog.

We recommend you use the ReportPrintTool class instead, which provides the similar PrintTool.PrintDialog method. This class also enables you to release the memory right after showing this dialog (for instance, by calling the Dispose method or utilizing the using statement).

See Also