A newer version of this page is available. Switch to the current version.

DocumentViewerControl.DocumentSource Property

Specifies the document source. This is a dependency property.

Namespace: DevExpress.Xpf.DocumentViewer

Assembly: DevExpress.Xpf.DocumentViewer.v19.2.Core.dll


public object DocumentSource { get; set; }
Public Property DocumentSource As Object

Property Value

Type Description

A Object value, specifying the document source.


The following source types are supported:

  • Stream;
  • Uri;
  • String;
  • objects implementing the Windows.Storage.Streams.IRandomAccessStream interface.

To create a custom DocumentPreviewWindow, assign the corresponding XtraReport, CachedReportSource or link to the 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;

Make sure to call the XtraReport.CreateDocument method before displaying the Print Preview.


See Also