Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can not get the report viewer to work on VS 2019

On Visual Studio 2019 I have added the Microsoft RDLC Report Designer from NuGet packages and I went ahead and added the Microsoft.ReportViewer.Winforms.dll to the project as well. I also created a .xsd and a .rdlc The reportviewer tool shows up on my toolbox and I am able to drag and drop it onto the form. The problem is, when I drop the report viewer tool onto my form, it doesn't open the report view. Instead, it goes to the bottom of the form, just like the timer tool does. I double click on it and it does nothing. I followed the same steps on VS 2017 and was able to create a report.

I already uninstalled the packages and re-installed them and it keeps behaving the same way.

I expect the report viewer to display as it did in VS 2017

like image 594
Yorelis Avatar asked Dec 13 '22 11:12

Yorelis


1 Answers

I'm using version 150.1404.0 and the issue is still present. The bug is not in the reporting control, it is a VS2019 code generator bug. The code lacks the line that actually adds the control on the form:

this.Controls.Add(reportViewer1);

This needs to be placed after the control was initialized and before the

this.ResumeLayout(false);

line in the InitializeComponent() method, which can be found in the formName.Designer.cs

like image 94
Yuriy S Avatar answered Dec 28 '22 08:12

Yuriy S