locked
Multiple Dataset in RDLC RRS feed

  • Question

  • User963319391 posted

    Hi All

    Is it posible to use two or more dataset in a RDLC report?

    Can anyone guide me about this?

    Tuesday, September 17, 2013 5:38 AM

Answers

  • User-417640953 posted

    Hi Jane1987,

    I’m glad to you post the issue to our forum.

    For using multiple datasets in one RDLC file, it is possible to complete that.

    First we should define multiple dataset in RDLC file, Then we add the datasource to ReportViewer like below.

    ReportViewer1.LocalReport.DataSources.Add(DataTable1);
    ReportViewer1.LocalReport.DataSources.Add(DataTable2);

    In above code, we can see that two DataTables correspond to the two datasets defined in RDLC.

    And the two DataTables will come from different System.Data.DataSet.

    Live sample:

    http://www.c-sharpcorner.com/UploadFile/robo60/StandaloneRDLCReports11142007183516PM/StandaloneRDLCReports.aspx

     

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 22, 2013 2:17 AM

All replies

  • User1070236303 posted

    I have only familiar with winform version (never used in asp.net), but the answer is yes. In the report data windows you can add multiple datasets, parameters etc. To open the report data window look for the last item in the view menu when the rdlc designer is active, or press ctrl+alt+d (applies to vs2010/vs2012)

    Tuesday, September 17, 2013 6:33 AM
  • User-417640953 posted

    Hi Jane1987,

    I’m glad to you post the issue to our forum.

    For using multiple datasets in one RDLC file, it is possible to complete that.

    First we should define multiple dataset in RDLC file, Then we add the datasource to ReportViewer like below.

    ReportViewer1.LocalReport.DataSources.Add(DataTable1);
    ReportViewer1.LocalReport.DataSources.Add(DataTable2);

    In above code, we can see that two DataTables correspond to the two datasets defined in RDLC.

    And the two DataTables will come from different System.Data.DataSet.

    Live sample:

    http://www.c-sharpcorner.com/UploadFile/robo60/StandaloneRDLCReports11142007183516PM/StandaloneRDLCReports.aspx

     

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 22, 2013 2:17 AM