【问题标题】:How to retrieve dataset in RDLC report where one stored procedure return multiple table如何在 RDLC 报告中检索一个存储过程返回多个表的数据集
【发布时间】:2015-09-22 02:57:57
【问题描述】:
我正在创建一个.rdlc 报告。将有三张桌子展示。
我写了一个存储过程 Like
select a,b,c from table A
select a1,b1,c1 from table A1
select a2,b2,c2 from table A2
主要是我的过程从这三个表中返回数据。
但我无法理解如何在三个单独的数据集中捕获它们。
【问题讨论】:
标签:
sql
sql-server
asp.net-mvc
asp.net-mvc-3
rdlc
【解决方案1】:
你可以划分三个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);
要捕获数据集,您需要经历一个过程,对于每个块(注释掉其他块),您需要分别执行每个块。在将它们放入数据集中后,只需执行完整的过程。