Back to Devexpress

XtraReportPreviewExtensions.PrintDialog(IReport) Method

windowsforms-devexpress-dot-xtrareports-dot-ui-dot-xtrareportpreviewextensions-dot-printdialog-x28-devexpress-dot-xtrareports-dot-ireport-x29.md

latest2.9 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public static DialogResult PrintDialog(
    this IReport report
)
vb
<ExtensionAttribute>
Public Shared Function PrintDialog(
    report As IReport
) As DialogResult

Parameters

NameTypeDescription
reportIReport

An object implementing the IReport interface.

|

Returns

TypeDescription
DialogResult

A DialogResult enumeration value.

|

Remarks

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

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

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

XtraReport1 report = new XtraReport1();
report.PrintDialog();
vb
Imports DevExpress.XtraReports.UI
' ...

Dim report As XtraReport1 = 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

XtraReportPreviewExtensions Class

XtraReportPreviewExtensions Members

DevExpress.XtraReports.UI Namespace