How to get dataset in RDLC report where one stored procedure returns multiple tables
I am creating a report .rdlc
. There will be three tables to display.
I wrote a stored procedure As
select a,b,c from table A
select a1,b1,c1 from table A1
select a2,b2,c2 from table A2
Basically my procedure returns data from these three tables.
But I couldn't figure out how to catch them in three separate datasets.
+3
source to share
1 answer
you can split three ds and use them like
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);
and to catch a dataset you have to go through a process where for each block (comment out other blocks) you need to execute each block separately. Once you get them in the dataset, just follow the full procedure.
+3
source to share