asma
asma

Reputation: 2845

Can I assign RDLC object data source, my own data table?

I have an rdlc file that has a datasource. But I want to assign a data table to it at runtime. Can I do this in CS file?

I want to generate a datatable at runtime and want to use it in rdlc file's object datasource. Please suggest solutions.

Upvotes: 0

Views: 1385

Answers (1)

Jith
Jith

Reputation: 1701

You can try this


var rptSource = new ReportDataSource("TableName", objDataTable);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rptSource);
ReportViewer1.LocalReport.Refresh();

Upvotes: 3

Related Questions