windowsforms-devexpress-dot-xtrareports-dot-ui-dot-xtrareportpreviewextensions-dot-showribbonpreviewdialog-x28-devexpress-dot-xtrareports-dot-ireport-devexpress-dot-lookandfeel-dot-userlookandfeel-x29.md
Opens the report document in the ribbon-based Print Preview form modally with the specified look and feel settings.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraPrinting.v25.2.dll
NuGet Package : DevExpress.Win.Printing
public static void ShowRibbonPreviewDialog(
this IReport report,
UserLookAndFeel lookAndFeel
)
<ExtensionAttribute>
Public Shared Sub ShowRibbonPreviewDialog(
report As IReport,
lookAndFeel As UserLookAndFeel
)
| Name | Type | Description |
|---|---|---|
| report | IReport |
An object implementing the IReport interface.
| | lookAndFeel | UserLookAndFeel |
A UserLookAndFeel object which specifies the look and feel settings applied to Print Preview.
|
Call the ShowRibbonPreviewDialog 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.v25.2.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.ShowRibbonPreviewDialog(myLookAndFeel);
Imports DevExpress.XtraReports.UI
' ...
Dim report As XtraReport1 = New XtraReport1
Dim myLookAndFeel As UserLookAndFeel = New UserLookAndFeel(report)
myLookAndFeel.SkinName = "Office 2016 Colorful"
myLookAndFeel.UseDefaultLookAndFeel = false
report.ShowRibbonPreviewDialog(myLookAndFeel)
We recommend you use the ReportPrintTool class instead, which provides the similar PrintTool.ShowRibbonPreviewDialog 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 ShowRibbonPreviewDialog method in Web applications. Use the Web Document Viewer instead.
See Also
XtraReportPreviewExtensions Class