我正在制作.rdlc
报告。展会将有三个表。
我写了一个存储过程,如
select a,b,c from table A
select a1,b1,c1 from table A1
select a2,b2,c2 from table A2
主要是我的程序从这三个表中返回数据。
但是我无法理解如何在三个单独的数据集中捕获它们。
答案 0 :(得分:3)
你可以将三个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);
并且为了捕获数据集,您需要经历一个过程,对于每个块(注释掉其他块),您需要分别执行每个块。在获取数据集后,只需执行完整过程。