Hi,
Thanks in Advacne,
I'm using Reporting Service 2000 Web Service SetReportDataSources method to associate Datasource with Report. But I'm getting error.
"The data source 'DS_Code_002' cannot be found in this report. --> The data source 'DS_Code_002' cannot be found in this report. "
I searched lot but i didn't get solution .Some posts telling like "this is a bug in RSWS". Please help me to resolve the issue.
Code:
DataSourceReference reference = new DataSourceReference();
reference.Reference = txtDSPath.Text;
DataSource[] dataSources = new DataSource[1];
DataSource ds = new DataSource();
ds.Item = (DataSourceDefinitionOrReference) reference;
ds.Name = "Dsname";
dataSources[0] = ds;
rs.SetReportDataSources(txtReportPath.Text, dataSources);
Thanks again,
Krishna kumar.M
Hi,
After the long try myself found the answer.
if datasource name is same like the hardcoded data source name in .rdl file it is working fine
So I chnage to code as follows now it is working fine. Otherwise you have to change the name in .rdl file manually.
Code
DataSourceReference dRef= new ReportingService.ReportingServiceWS.DataSourceReference( );
dRef.Reference = txtDSPath.Text;
DataSource []ds = rs.GetReportDataSources(txtReportPath.Text);
DataSource d = new ReportingService.ReportingServiceWS.DataSource();
d.Item = (RS.DataSourceDefinitionOrReference)dRef;
d.Name= ds[0].Name; // Get the new name store it in new object
ds[0] = d;
rs.SetReportDataSources(txtReportPath.Text,ds);
No comments:
Post a Comment