[ACCEPTED]-Using MS ReportViewer in WPF-reportviewer

Accepted answer
Score: 26

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

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

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

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

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

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

Take 1 care,
Martin

Score: 24

We've definitely had success just using 9 the WindowsFormsHost. I haven't been involved 8 in creating the RDLC files themselves, but 7 I believe they were designed (as you say) in 6 a WinForms project and then copied across.

Note 5 that if you don't need local reports you 4 can use a WPF Frame control and point it 3 at the URL of the server-based report (it 2 renders it like a web browser would). This 1 works really well for us too.

Score: 3

Please note that you can use both WPF-Windows 6 and Windows-Form-Windows in the same application.

So 5 you can avoid using WindowsFormsHost if 4 you put the ReportViewer in a seperate Windows-Forms-Window 3 that you open from your WPF-Window with 2 ShowDialog.

Then you can use the ReportViewer 1 also at design time.

More Related questions