Back to Devexpress

XtraReportPreviewExtensions Class

windowsforms-devexpress-dot-xtrareports-dot-ui-1ca9cbd9.md

latest3.9 KB
Original Source

XtraReportPreviewExtensions Class

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

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
[DXLicenseWinReporting]
public static class XtraReportPreviewExtensions
vb
<DXLicenseWinReporting>
Public Module 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.v25.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.

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

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

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

XtraReportPreviewExtensions Members

XtraReportDesignerExtensions

DevExpress.XtraReports.UI Namespace