Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with Report Viewer in VS2013

Hi,

My project was running ok in VS20010, however when trying to run the same project in VS2013, I receive

error message: Microsoft.Reporting.WinForms.ReportDatasource is not defined.

on line:  Dim reportDataSource As New Microsoft.Reporting.WinForms.ReportDataSource()

What do I need to import in VS2013 to solve this error?

Code:
Dim reportDataSource As New Microsoft.Reporting.WinForms.ReportDataSource()
            reportDataSource.Name = "DataSet1"
            reportDataSource.Value = FilteredDT
            ReportViewer1.LocalReport.DataSources.Clear()
            ReportViewer1.LocalReport.DataSources.Add(reportDataSource)
            ReportViewer1.LocalReport.Refresh()
            ReportViewer1.RefreshReport()

Thanks,

Victor
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

check your project References make sure there is no missing libraries for report viewer?

you may also go to NuGet Package Manager to update the Report Viewer packages.
Avatar of Victor  Charles

ASKER

How do you update the Report Viewer packages using NuGet?
Thanks,
V.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was able to install the ReportViewer online but now receiving error message" ReportViewer1 is not accessible, it may be inaccessible due to protection level. Error occurs on the following lines:

ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(reportDataSource)
ReportViewer1.LocalReport.Refresh()
ReportViewer1.RefreshReport()

Thanks,

V
try to see if you got similar error when you create a new report viewer in a now form?
It works!

Thanks,

Victor