DocumentPreviewWindow Class
A window containing a Print Preview.
Namespace: DevExpress.Xpf.Printing
Assembly: DevExpress.Xpf.Printing.v17.2.dll
Declaration
Remarks
To display a default Print Preview without creating a custom preview window, use the methods of the PrintHelper class.
To create a custom Print Preview window, assign a corresponding XtraReport or link to the DocumentViewerControl.DocumentSource property (available via the DocumentPreviewWindow.PreviewControl property).
using DevExpress.Xpf.Printing;
using System.Windows;
// ...
private void Button_Click(object sender, RoutedEventArgs e) {
XtraReport1 report = new XtraReport1();
var window = new DocumentPreviewWindow();
window.PreviewControl.DocumentSource = report;
report.CreateDocument();
window.Show();
}
Make sure to call the XtraReport.CreateDocument method before displaying the Print Preview.
For step-by-step tutorials, see Document Preview and How to: Use the Simple Link.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentPreviewWindow class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.