6
votes

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:

enter image description here

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.

1

1 Answers

6
votes

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);