The requested page is not available for the requested platform. You are viewing the content for Default platform.

Document Viewer for Silverlight

  • 2 min to read

This document describes the Document Viewer that is used to display report previews in Silverlight applications.

Invoking the Document Viewer

For Silverlight, the XtraReports Suite provides a DocumentViewer control, intended for publishing reports in Silverlight applications. The Document Viewer can also display a toolbar (a BarManager or a RibbonControl) that contains buttons for performing various operations on a document.

document-preview-silverlight

To show a report in a Document Viewer, add a DocumentViewer instance to your Silverlight application.

drop-control-document-preview-silverlight-14-2

Then, perform the following steps.

  1. Add a report and a ReportService to the application.
  2. Enable the AutoCreateDocument property of the added Document Viewer, and define its DocumentViewer.Model property as follows.

    <dxp:DocumentViewer Name="documentViewer1" AutoCreateDocument="True">
        <dxp:DocumentViewer.Model>
            <dxp:ReportPreviewModel ServiceUri="../ReportService1.svc"
                                    ReportName="SilverlightApplication1.Web.XtraReport1" />
        </dxp:DocumentViewer.Model>
    </dxp:DocumentViewer>
    
  3. You can also customize the Document Viewer, which is demonstrated in the following online example: How to customize the DocumentPreview toolbar.

Document Viewer Features

The Document Viewer provides the following options for performing various operations on the document.

  • Document Map panel - displays a report's table of contents.
  • Parameters panel - used to set the values of report parameters.
  • Page Setup button - invokes a dialog to set a document's paper format, page orientation and margins.
  • Zooming controls - the Zoom drop-down button, as well as the Zoom In and Zoom Out buttons, make the report appear larger or smaller on the screen.
  • Navigation buttons - allow you to switch between report pages.
  • Export drop-down buttons - allow you to export a report to various formats.
  • Watermark button - invokes a dialog to add a new text or image watermark to a report or customize an existing one.