I am running ReportViewer 10 using a local report (rdl) file in an MVC web site. I am passing in a DataSet that has the correct data with column names that match the report definition.
var reportDataSource = new ReportDataSource("dataset1", resultSet);
ReportViewer1.LocalReport.ReportPath = Server.MapPath("/Reports/Report2.rdl");
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(reportDataSource);
List<ReportParameter> lst = new List<ReportParameter>();
ReportParameter rptParam1 = new ReportParameter("Id", "54");
lst.Add(rptParam1);
ReportViewer1.LocalReport.SetParameters(lst);
ReportViewer1.LocalReport.Refresh();
The error I am getting is:
I am unable to find any more specific information on the exact error. Is there a log file somewhere I can look at?
Thank you.
The solution is to relocate the files or create the files for the previously deleted database connections. I.e., to reuse the exact same name for the connections as previously used. Finally, to avoid this kind of error, it is very important to regularly compile the code of your SSRS project and to save your objects.
Click Start > Administrative Tools > Services to open the Services management console. Right-click the SQL Server Reporting Services ([InstanceName]) service, and then click Restart.
The report server processes a report in three steps: report processing, data processing, and rendering.
To refresh the field collection in the Report Data Pane for a shared dataset. In the Report Data pane, right-click the dataset, and then click Query. Click Refresh Fields. On the report server, the shared dataset query runs and returns the current field collection.
it turns out that the name of the dataset must match the named defined in the report file exactly including case.
var reportDataSource = new ReportDataSource("dataset1", resultSet);
Becomes:
var reportDataSource = new ReportDataSource("DataSet1", resultSet);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With