In other words I created an .rss script that generates all the folders and creates and uploads all the reports and data sources to Reporting Services. The problem is that I have to then go in and manually point each report to the right data source. I would like to automate this task too within the .rss script.
Learnthis is the sample i used to attach the datasource but it still does not work:
Dim fullpath As String = SubFolderPath + "/Report.rdl"
Dim dataSources(0) As DataSource
Dim dsr0 As New DataSourceReference
dsr0.Reference = "/Mydir/Test/mydatasourcename"
Dim ds0 As New DataSource
ds0.Item = CType(dsr0, DataSourceDefinitionOrReference)
ds0.Name="mydatasourcename"
dataSources(0) = ds0
rs.SetItemDataSources(fullpath, dataSources)i
The error I keep getting when i click the report I just published is:
"The report server cannot process the report. The data source connection information has been deleted. (rsInvalidDataSourceReference)"
And the error I get from the cmd is :
"Unhandled exception:
The data source 'cdo_suite_5_qa' cannot be found."
Any advice would be very helpful.
Steve
The fullpath does not need the .rdl extension but only the path and name of the report.
You could also try rs.SetReportDataSources rather then rs.SetItemDataSources.
No comments:
Post a Comment