Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Report Viewer (rdcl) in MVVM scenario

I'm about to start making some reports in my application, and I'm not sure where to start. I have an client app with Prism and MVVM that communicates with an WCF service and EF4.1 and SQL in the back.

How do I get the report designer to support a ViewModel?

Any good examples would be appreciated.

Edit: I have an basic understanding on how to do this, but it's not a good one and I hope for a better solution that might help...

like image 895
rozon Avatar asked Aug 22 '11 08:08

rozon


1 Answers

There is no way to support features like Binding to a ViewModel on ReportViewer Control, since it is a WinForms control.

To handle the report viewer we use an interface, which is implemented by the View, which hosts the ReportViewer. The ViewModel has a property for this interface an can communicate directly with the ReportViewer to set the ServerReport path, credentials and parameters. Report parameters are provided as usual properties in the viewmodel, which on update also set the properties on the ReportViewer.

like image 157
JanW Avatar answered Sep 19 '22 11:09

JanW