XtraReportPreviewExtensions.ShowPreview(IReport, UserLookAndFeel) Method
Opens the report document in the standard Print Preview form with the specified look and feel settings.
NuGet Package: DevExpress.Win.Printing
public static void ShowPreview( this IReport report, UserLookAndFeel lookAndFeel )
<ExtensionAttribute> Public Shared Sub ShowPreview( report As IReport, lookAndFeel As UserLookAndFeel )
An object implementing the IReport interface.
A UserLookAndFeel object which specifies the look and feel settings applied to Print Preview.
Call the ShowPreview method to open the report in the default Print Preview form with a Standard Toolbar.
To be able to use this method, you should add the DevExpress.XtraPrinting.v22.1.dll to your project’s References list.
The following example demonstrates how to invoke Print Preview with custom look and feel settings.
using DevExpress.XtraReports.UI; // ... XtraReport1 report = new XtraReport1(); UserLookAndFeel myLookAndFeel = new UserLookAndFeel(report); myLookAndFeel.SkinName = "Office 2016 Colorful"; myLookAndFeel.UseDefaultLookAndFeel = false; report.ShowPreview(myLookAndFeel);
We recommend you use the ReportPrintTool class instead, which provides the similar PrintTool.ShowPreview 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).
You cannot use the ShowPreview method in Web applications. Use the Web Document Viewer instead.