Using MS ReportViewer in WPF

Yes, that works, I am using the WindowsFormsHost in a wpf project to wrap the ReportViewer.

In the ViewModel I am creating the WindowsFormsHost and the ReportViewer:

WindowsFormsHost windowsFormsHost = new WindowsFormsHost();
reportViewer = new ReportViewer();
windowsFormsHost.Child = reportViewer;
this.Viewer = windowsFormsHost

and in the View I am using a ContentPresenter to display it, by binding to the Property that holds the WindowsFormsHost.

 <ContentPresenter Content="{Binding Viewer}" ...

We’re using the Business Intelligence Studio (which is an Visual Studio 2008 with templates for editing reports) for report creation. http://msdn.microsoft.com/en-us/library/ms173767.aspx

Take care,
Martin

Leave a Comment