data not added to .rdlc report file, need help RRS feed

  • Question

  • User1070938216 posted

    i want to add the customer list to Report1.rdlc file,

    what i did is, i added CustomerList.xsd file and added a DataTable to it

    i filled that data table by the code written below, 

    but the data is not shown to report, please help

    DataTable dt = new DataTable();
    DataTable dt1 = new DataTable();
    ds = cdobj.getCustomerListForDataset();
    if (ds.Tables[0].Rows.Count > 0)

    dt1 = ds.Tables[0];
    DataRow drow;

    CustomerList cl = new CustomerList();
    //CustomerList cl =
    dt = cl.Tables["DataTable1"];
    for (int i = 0; i < dt1.Rows.Count; i++)
    drow = dt.NewRow();
    drow[i] = dt1.Rows[i];
    this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("test", cl));
    catch(Exception ex)

    Monday, October 22, 2012 7:51 AM

All replies

  • User765438783 posted

    Hello Sanjay,

    I am not sure, but I feel that you are adding all the rows to datatable dt, but not updating cl.

    Finally, you need to update cl, because that is the datasource for the report.

    Hope I gave some useful information.


    Wednesday, October 24, 2012 3:51 PM
  • User1070938216 posted

    thank you krishna for your reply, but it's not working after updating cl also.......

    i also tried like this.....

    this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("test", dt));

    Tuesday, October 30, 2012 2:01 AM
  • User-1185172246 posted

    A couple of things:

    1. Is your app a Windows Forms one? Because I see Microsoft.Reporting.WinForms.ReportDataSource which refers to the Report Viewer win forms edition.

    2. What is the exact name you set up for the data source in the RDLC report? If it is e.g. DataSet1 then you must use that name in this line:

    this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", cl));

    Otherwise reportviewer will not be able to do the binding.

    Tuesday, October 30, 2012 7:20 AM
  • User1070938216 posted

    i got the problem, datatable dt is not being filled, thats why no data is shown to report

    Saturday, November 24, 2012 1:31 AM