如何在一个存储过程 return 多个 table 的 RDLC 报告中检索数据集

How to retrieve dataset in RDLC report where one stored procedure return multiple table

我正在创建 .rdlc 报告。将有3个table进行展示

我写了一个存储过程Like

  select a,b,c from table A
  select a1,b1,c1 from table A1
  select a2,b2,c2 from table A2

主要是我的程序returns这三个table的数据。

但我无法理解如何在三个单独的数据集中捕获它们。

你可以把三个ds分开来用

        mySqlDataAdapter.Fill(myDataSet, "STS_rptYarnLedger");

        ReportDataSource datasource = new ReportDataSource("dsSTab1", myDataSet.Tables[0]);
        ReportDataSource datasource1 = new ReportDataSource("dsTab2", myDataSet.Tables[1]);
        ReportDataSource datasource2 = new ReportDataSource("dsTab3", myDataSet.Tables[2]);

        rvYarnStock.LocalReport.DataSources.Clear();
        rvYarnStock.LocalReport.DataSources.Add(datasource);
        rvYarnStock.LocalReport.DataSources.Add(datasource1);
        rvYarnStock.LocalReport.DataSources.Add(datasource1); 

并且要捕获数据集,您需要经历一个过程,其中对于每个块(注释掉其他块),您需要执行每个块 separately.and 在将它们放入数据集中后,只需执行完整的过程。