Reporting for WPF - How to Use the DocumentPreviewControl in a WPF MVVM Application to Preview a Report
This example demonstrates how to bind the DocumentPreviewControl.DocumentSource property to the report source in the ViewModel. The project implements a command to show the report preview in a modal window. In this example the reports are stored in the SQLite database.
The ReportCatalogViewModel view model retrieves reports from a database and defines the following commands:
ShowReport
. Assigns a report instance to the view model property bound to the DocumentViewerControl.DocumentSource property.ShowPreviewInNewWindow
. Creates the DocumentPreviewDialogViewModel view model instance that contains the current report. Uses the DialogService to show the modal window with the report preview.
- MainWindow.xaml (MainWindow.xaml)
- ReportCatalogViewModel.cs (ReportCatalogViewModel.vb)
- DocumentPreviewDialogViewModel.cs (DocumentPreviewDialogViewModel.vb)
- Document Preview API and Customization
- Quick Guide to Print Preview Customization
- DevExpress MVVM Framework
(you will be redirected to DevExpress.com to submit your response)