Provides extension methods that enable you to show a report in a WinForms Print Preview.
Use the XtraReportPreviewExtensions class’s methods to load a report into one of the default Print Preview forms.
- The XtraReportPreviewExtensions.ShowRibbonPreview and XtraReportPreviewExtensions.ShowRibbonPreviewDialog methods show a form with a Ribbon Toolbar.
- The XtraReportPreviewExtensions.ShowPreview and XtraReportPreviewExtensions.ShowPreviewDialog methods show a form with a Standard Toolbar.
Each of these methods has overloads to invoke the Print Preview form with either the default or custom look and feel settings applied.
To be able to use these extension methods, you should add the DevExpress.XtraPrinting.v19.1.dll to your project’s References list.
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).