Add more than one tables in RDLC

DhavalR picture DhavalR · Jan 16, 2015 · Viewed 7.7k times · Source

As question states I want to add more than one table in RDLC report. I have added one table in few reports. But don't know how to add multiple tables in a single report. I am adding tables using objects as DataSource. My database is SQLite.

I found a tutorial to make rdlc using object as datasource here. But that does not say about multiple tables. How to do it?

Answer

varsha picture varsha · Jan 16, 2015

you can do this following steps given below ,

1.Create 2 dataset in RDLC file in respect to each table

2.Pass these 2 dataset from your code

ReportDataSource rds = new ReportDataSource("dsChart",ObjectDataSource1);

ReportDataSource rds2 = new ReportDataSource("DataSet1",ObjectDataSource2);

rptViewer.LocalReport.DataSources.Clear();

rptViewer.LocalReport.DataSources.Add(rds);

rptViewer.LocalReport.DataSources.Add(rds2);

moreover you can relate with this tutorial