Click here to Skip to main content
16,020,669 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone, I'm working with VS2022, C# WPF and I want some reports using RDLC, I have already downloaded Microsoft RDLC designer 2022. I have already made the first design of the report. But in my XAML window when trying to use ReportViewer
<WindowsFormsHost Height="410" Width="749">
            <rdlcreport:ReportViewer x:Name="_reportviewer" />
   </WindowsFormsHost>

it gives me the following error: ReportViewer is not supported in WPF projects.
How can I solve this? Thanks to all.

What I have tried:

I've search for days in internet for examples and I have found nothing.
Posted
Updated 26-Jan-23 4:27am
v2

It seems that the newest feature of RDCL has been released in the VS Marketplace since vs2022 v17.1 as per MICROSOFT.

You can either go to THIS link to download the vsix file or you can do the following -
1. Open VS2022
2. In your top menus, go to Extensions
3. Select Visual Studio Marketplace
4. Search for Microsoft RDLC Report Designer 2022
5. Select download
6. Close VS2022, your file will be downloaded and installed when you re-open VS2022

If you are having issues, please see THIS how-to tutorial video.

You will find a HOW-TO CREATE a RDCL REPORT at this link with all the sample code needed.
 
Share this answer
 
v2
Comments
Member 15639943 25-Jan-23 11:08am    
Thanks Andre for your time and help, but to be exact, the problem is when I try to put the ReportViewer in the XAML window:
<windowsformshost height="410" width="749>
<rdlcreport:ReportViewer x:Name=" _reportviewer"="">

Show me this message error: "ReportViewer is not supported in WPF projects." How can I solve this? Thanks to all.
Andre Oosthuizen 26-Jan-23 8:13am    
Please do not post your comments under a solution block. To use ReportViewer in a WPF project you have to use WinForm Host control as per https://social.msdn.microsoft.com/Forums/en-US/e76dfb2a-b523-4c3b-96c1-cd53c57846fe/no-report-viewer-control?forum=vbgeneral. You can do this by following this step by step walk through - https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/walkthrough-hosting-a-windows-forms-control-in-wpf?view=netframeworkdesktop-4.8
Member 15639943 26-Jan-23 12:00pm    
Thanks for your help and advice.
Andre Oosthuizen 27-Jan-23 0:29am    
Only a pleasure. Please mark as solved, thank you.
I've found that the problem is here in the XAML code:

xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"


I have instaled Microsoft RDLC Report Designer 2022 without problem, but the files Microsoft.ReportViewer.Common.dll and Microsoft.ReportViewer.WinForms.dll are not in my project.
 
Share this answer
 
v2
I uninstalled and reinstalled RDLC for 2022 and it seems to have fixed the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900