Back to Devexpress

DocumentPreviewControl Class

wpf-devexpress-dot-xpf-dot-printing-778677c3.md

latest5.6 KB
Original Source

DocumentPreviewControl Class

A control that you can use to publish (preview, print, and export) documents in WPF applications.

Namespace : DevExpress.Xpf.Printing

Assembly : DevExpress.Xpf.Printing.v25.2.dll

NuGet Package : DevExpress.Wpf.Printing

Declaration

csharp
[DXLicenseWpfReporting]
public class DocumentPreviewControl :
    DocumentViewerControl,
    IParameterPanelHandler,
    IDocumentPreviewUI
vb
<DXLicenseWpfReporting>
Public Class DocumentPreviewControl
    Inherits DocumentViewerControl
    Implements IParameterPanelHandler,
               IDocumentPreviewUI

The following members return DocumentPreviewControl objects:

Remarks

The DocumentPreviewControl allows you to choose between a Ribbon or Bars toolbar layout.

Do the following to create a Print Preview to publish documents:

  1. Assign a document source to the DocumentPreviewControl’s DocumentSource property.

  2. If you use an IReport or ILink object as a document source, call the document source’s CreateDocument method or set the DocumentPreviewControl’s RequestDocumentCreation property to True to generate a preview.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentPreviewControl 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.

reporting-wpf-mvvm-show-report-document-preview/CS/MainWindow.xaml#L16

xml
<DataTemplate>
    <dxp:DocumentPreviewControl RequestDocumentCreation="True"
                                DocumentSource="{Binding Report}" />

reporting-wpf-custom-editor-for-report-parameter/CS/CustomParameterEditorsWPF/MainWindow.xaml#L36

xml
</Window.Resources>
    <dxp:DocumentPreviewControl x:Name="preview" />
</Window>

reporting-wpf-use-private-custom-font-distributed-with-application/CS/PrivateFontDemo/MainWindow.xaml#L6

xml
<Grid>
    <dxp:DocumentPreviewControl Name="preview" />
</Grid>

reporting-wpf-hide-specific-export-formats-from-the-document-preview-control/CS/HideExportFormats/MainWindow.xaml#L18

xml
<Grid>
    <dxp:DocumentPreviewControl Name="preview" CommandBarStyle="Bars">
        <dxp:DocumentPreviewControl.HiddenExportFormats>

wpf-reporting-use-custom-controls-for-editing-report-content-in-print-preview/CS/MainWindow.xaml#L26

xml
<DataTemplate>
    <dxp:DocumentPreviewControl RequestDocumentCreation="True" DocumentSource="{Binding Report, Mode=OneWay}" />
</DataTemplate>

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control DocumentViewerControl DocumentPreviewControl

See Also

DocumentPreviewControl Members

PrintHelper

DocumentPreviewWindow

WPF Reporting Document Preview

DevExpress.Xpf.Printing Namespace