DocumentViewerControl.DocumentSource Property
Specifies the document source. This is a dependency property.
Namespace: DevExpress.Xpf.DocumentViewer
Assembly: DevExpress.Xpf.DocumentViewer.v25.1.Core.dll
NuGet Package: DevExpress.Wpf.DocumentViewer.Core
Declaration
Property Value
Type | Description |
---|---|
Object | A Object value that specifies the document source. |
Remarks
The following source types are supported:
- XtraReport
- CachedReportSource
- String (a path to a PRNX file; a path can be absolute or relative to the application’s executable file)
- Stream (PRNX content)
- Uri (a link)
- objects implementing the Windows.Storage.Streams.IRandomAccessStream interface
You can use the DocumentSource
property to load a previously saved document from the PRNX file:
documentPreview.DocumentSource = @"...\Invoice.prnx";
To create a custom DocumentPreviewWindow, assign a document source to the DocumentSource
property (available when using 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.
To resolve subreport names, call ReportStorageExtension.RegisterExtensionGlobal.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentSource property.
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.