Document Viewer for Silverlight
- 2 minutes 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.
To show a report in a Document Viewer, add a DocumentViewer instance to your Silverlight application.
Then, perform the following steps.
- Add a report and a ReportService to the application.
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>
- 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.