Microsoft reportviewer cant use in WPF
Asked
Active
Viewed 79 times
0

Anant Dabhi
- 10,864
- 3
- 31
- 49

dinod tharinda
- 1
- 1
-
Your dot net version? Because there is no report viewer for dot net 5 and on-wards. – Muhammad Waqas Aziz Jun 08 '22 at 11:03
-
Report Viewer will only work if your using dot net 4.8 – Muhammad Waqas Aziz Jun 08 '22 at 11:04
-
I think it is version 4 – dinod tharinda Jun 08 '22 at 11:24
-
install this nuget in your project https://www.nuget.org/packages/Microsoft.ReportingServices.ReportViewerControl.Winforms/ – Muhammad Waqas Aziz Jun 08 '22 at 11:28
-
And there is a WindowsFormsHost control in wpf, you can use that control to put Windows form report viewer in wpf – Muhammad Waqas Aziz Jun 08 '22 at 11:31
-
here is an example https://www.c-sharpcorner.com/UploadFile/nipuntomar/report-viewer-control-in-wpf/ – Muhammad Waqas Aziz Jun 08 '22 at 11:32
-
`ReportViewer` is a *WinForms* component, not a WPF component. You must add it in the `.NET Framework Components` tab if it's not there already. Adding a WinForms component on a WPF page is described in the WPF docs, at [Walkthrough: Hosting a Windows Forms Control in WPF](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/walkthrough-hosting-a-windows-forms-control-in-wpf?view=netframeworkdesktop-4.8) – Panagiotis Kanavos Jun 08 '22 at 12:01
1 Answers
0
You cannot just add Reportviewer control into toolbox to drag and drop, you must require to use WindowsFormsHost
to put reportviewer control into your application
Something like below : WindowsFormsHost wHost = new WindowsFormsHost(); var reportV = new ReportViewer(); wHost.Child = reportV;

Anant Dabhi
- 10,864
- 3
- 31
- 49