Changing an SSRS report's data source reference
In this recipe, we will update an SSRS report's data source.
Getting ready
In our recipe we will change the data source of our report /Customers/Customer Contact Numbers
, which originally uses the data source reference /Data Sources/Sample
to point to /Data Sources/KERRIGAN
.
Alternatively, pick an existing report in your environment and the data source you want this report to reference. Note the names and the path to these items.
How to do it...
Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
Add the following script and run:
$ReportServerUri = "http://localhost/ReportServer/ReportService2010.asmx" $proxy = New-WebServiceProxy -Uri $ReportServerUri -UseDefaultCredential #get autogenerated namespace $type = $proxy.GetType().Namespace #specify which report's data source to change $reportPath = "/Customers/Customer Contact Numbers" #look for the report in the catalog items array #note we...