Answer the question
In order to leave comments, you need to log in
How to populate reportViewer C# programmatically?
Hello. There is a database created in access.
The form has a completely empty reportviewer. I want to fill it programmatically, not through the constructor.
I'm trying to do this:
OleDbDataAdapter dataAdapter = new OleDbDataAdapter("Select * FROM Orders", Connect.con);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
reportViewer1.Reset();
this.reportViewer1.LocalReport.DataSources.Clear();
ReportDataSource reportDataSource = new ReportDataSource();
reportDataSource.Value = ds.Tables[0];
reportDataSource.Name = "DataSetAssetList";
this.reportViewer1.LocalReport.DataSources.Add(reportDataSource);
this.reportViewer1.LocalReport.ReportEmbeddedResource = "AssestsManagementSystem.ReportAssetList.rdlc";
this.reportViewer1.RefreshReport();
An error occurred while processing the report locally.
The ReportAssetList report has no definition.
An object reference does not point to an instance of an object.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question