Scarlett72
asked on
Change datasource for report viewer control programatically
Hi, how can I change the <rsweb:ReportDataSource DataSourceId= property of a report viewer control from
ObjectDataSource1 to ObjectDataSource2?
ObjectDataSource1 to ObjectDataSource2?
ASKER
Hi Jitendra, thank you for replying.
So in my .rdlc file,
my Data Source is called: "RF"
and
my dataset is called dsSalesDelta
So would would the arguments in new ReportDataSource look like this?
So in my .rdlc file,
my Data Source is called: "RF"
and
my dataset is called dsSalesDelta
So would would the arguments in new ReportDataSource look like this?
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("RF", dsSalesDelta));
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
reportViewer.LocalReport.D
reportViewer.LocalReport.D
"datasourcename" is the name of the data source, you can find it .rdlc file.
source is the variable with data you want to show in the report.
hope this helps.