Skip to main content

XtraReportPreviewExtensions Class

Provides extension methods that enable you to show a report in a WinForms Print Preview.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraPrinting.v23.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.Printing

Declaration

public static class XtraReportPreviewExtensions

Remarks

Use the XtraReportPreviewExtensions class’s methods to load a report into one of the default Print Preview forms.

Each of these methods has overloads to invoke the Print Preview form with either the default or custom look and feel settings applied.

The XtraReportPreviewExtensions.Print and XtraReportPreviewExtensions.PrintDialog methods allow you to print a report with the default settings or using the Print dialog.

To be able to use these extension methods, you should add the DevExpress.XtraPrinting.v23.2.dll to your project’s References list.

Note

You cannot use the XtraReportPreviewExtensions class methods in Web applications. Use the Web Document Viewer instead.

The following example demonstrates how to invoke the ribbon-based Print Preview.

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

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

We recommend you use the ReportPrintTool class instead, which provides the same methods to show Print Preview forms, but additionally allows you to customize them. This class also enables you to release the memory right after showing these forms (for instance, by calling the Dispose method or utilizing the using statement).

Inheritance

Object
XtraReportPreviewExtensions
See Also