XtraReportPreviewExtensions.ShowPreviewDialog(IReport) Method

Opens the report document in the standard Print Preview form modally.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraPrinting.v20.2.dll

Declaration

public static void ShowPreviewDialog(
    this IReport report
)
<ExtensionAttribute>
Public Shared Sub ShowPreviewDialog(
    report As IReport
)

Parameters

Name Type Description
report IReport

An object implementing the IReport interface.

Remarks

Call the ShowPreviewDialog method to open the report in the default Print Preview form with a Standard Toolbar modally.

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

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

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

We recommend you use the ReportPrintTool class instead, which provides the similar PrintTool.ShowPreviewDialog method and additionally allows you to customize the Print Preivew form. This class also enables you to release the memory right after showing this form (for instance, by calling the Dispose method or utilizing the using statement).

NOTE

You cannot use the ShowPreviewDialog method in Web applications. Use the Web Document Viewer instead.

See Also