Search code examples
winformsdata-bindingdatasetdatasource

Data sources empty on ReportViewer


I'm trying to link up my report viewer to the data sources, however the dialog box is empty -

Empty dialog box

I have a file called dsReports.xsd which has data sets that work when I preview data from there. Anyone know why this could be?

Thanks


Solution

  • I have got round this by programatically setting the data source -

    var myDataTable = new dsReports.tsPrimaryMondayDataTable();
            var myTableAdapter = new dsReportsTableAdapters.tsPrimaryMondayTableAdapter();
            myTableAdapter.Fill(myDataTable, Convert.ToDateTime(dtp.Value));
            var rds = new ReportDataSource("DataSet1", myDataTable as DataTable);
    
            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(rds);
            reportViewer1.RefreshReport();