gpt4 book ai didi

sql - 如何在一个存储过程返回多个表的 RDLC 报告中检索数据集

转载 作者:行者123 更新时间:2023-12-04 01:40:29 25 4
gpt4 key购买 nike

我正在创建一个 .rdlc 报告。将展示三张 table 。

我写了一个存储过程Like

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

主要是我的程序从这三个表中返回数据。

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

最佳答案

你可以划分三个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);

要捕获数据集,您需要经历一个过程,其中对于每个 block (注释掉其他 block ),您需要分别执行每个 block 。在将它们放入数据集中后,只需执行完整过程即可。

关于sql - 如何在一个存储过程返回多个表的 RDLC 报告中检索数据集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31220837/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com