I have SQL Server 2008 with SSRS installed on a single server, and SQL Server 2008 R2 with SSRS installed on a new server. I want to migrate 200+ reports, as well as several shared schedules and a couple of data sources from the first server to the second, using the SSRS web service API. For simplicity, since there are only a few common data sources, I went ahead and created those that use the report manager interface.
Unfortunately, those who came before me included information about data sources in each report (connection string, login, password, etc.). I thought it would be a great time to change them to point to a common data source, so this would not have to be done for each report one by one. I can create reports on the new server just fine using CreateCatalogItem, but I can’t determine how to properly switch from the built-in data source to the shared data source.
So far I have tried and SetItemReferences:
itemRef.Reference = "/Data Sources/TMS"; itemRef.Name = "TMS"; itemRef.Reference = "/Data Sources/TMS"; rs2010.SetItemReferences(catItem.Path, new ReportService2010.ItemReference[] { itemRef });
and SetItemDataSources:
ReportService2010.DataSourceReference dataSourceRef = new ReportService2010.DataSourceReference(); dataSourceRef.Reference = "/Data Sources/TMS"; ReportService2010.DataSource dataSource = new ReportService2010.DataSource(); dataSource.Name = "TMS"; dataSource.Item = dataSourceRef; rs2010.SetItemDataSources(catItem.Path, new ReportService2010.DataSource[] { dataSource });
Both methods result in a “NotFoundException” when trying to report with an embedded data source, but both of them work fine in reports that already point to a common data source.
In addition, I searched all over Google, as well as StackOverflow for a solution, but found nothing. Can someone point me in the right direction?
source share