Skip to main content
A newer version of this page is available. .

Document Preview

  • 3 minutes to read

This topic describes the DocumentPreviewControl that is used to display an interactive document preview in WPF applications.

The topic consists of the following sections.

Overview

The Document Preview displays document data provided by a document source of one of the following supported document source types.

  • An object implementing the IReport interface.
  • An object implementing the ILink interface.
  • A Stream containing report document data.
  • A string containing a path to a file that stores report document data (a PRNX file).

When a document is created, it is shown in the Document Preview.

document-preview-wpf

Invoke the Document Preview

To show a document in a Document Preview, use one of the following approaches.

For more details, see Document Preview.

Main Features

Toolbar

The Document Preview can include a toolbar and menu that contain buttons used to view, navigate, edit, print and export a document. The following two toolbar types are supported.

Each toolbar button triggers a specific command. For example, clicking the Page Setup… button triggers the DocumentPreviewControl.PageSetupCommand and invokes the Page Setup dialog, which is shown in the following image.

page-setup-dialog-wpf

Document Map Panel

If a document contains bookmarks, the Document Map panel becomes available and allows you to quickly navigate through the document.

document-map-panel-wpf

Parameters Panel

If a report has visible parameters, the corresponding button that defines the visibility of the Parameters panel becomes available. The Parameters user interface allows you to modify parameter values and update the document accordingly.

parameters-panel-wpf

Thumbnails Panel

The Thumbnails toolbar button changes the visibility of report thumbnails used to quickly navigate between document pages.

report-thumbnails-wpf

Search Panel

To search for a specific text throughout a document, invoke the dedicated Search panel by clicking the Search toolbar button.

search-panel-wpf

Interactivity

Content Editing

If content editing is enabled for document elements, it is possible to customize the corresponding field values in the Document Preview (clicking a field will invoke an appropriate editor). To highlight all editing fields available in a document, click the Editing Fields toolbar button.

content-editing-wpf

Drill-Down Reports

You can add the drill-down functionality to a report to display data partially. Hidden data can be accessed in the Document Preview by clicking the designated element.

drill-down-report

Document Preview Mouse Events

You can provide interactivity to reports shown in a Document Preview using the Preview’s mouse events (e.g., to create drill-through reports or enable data sorting directly in the preview).

For code samples, see the following examples online.

Customization

To learn how to customize the Document Preview, see the following tutorials:

See Also