Programmatically assign report to my reportViewer
You need to set both ReportPath
and DataSources
:
YourReportViewer.LocalReport.ReportEmbeddedResource = "ReportViewerForm.Report1.rdlc"
YourReportViewer.LocalReport.DataSources.Clear()
YourReportViewer.LocalReport.DataSources.Add(New ReportDataSource("YourTableName", yourDataTable))
you can do the following
var binding = new BindingSource();
binding.DataSource = yourData;
reportViewer1.Reset();
reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("NGStoreV2DataSet",
binding));
reportViewer1.LocalReport.ReportEmbeddedResource = "ReportViewerForm.Report1.rdlc";
reportViewer1.RefreshReport();
hope that this will help you