Custom OpsMgr reports: how to get rid of rsInvalidDataSourceReference error

Note: This post is about rsInvalidDataSourceReference error observed in System Center Operation Manager environments. Please consider this blog post for the more details about the nature of rsInvalidDataSourceReference. That description is applicable for any SSRS deployment.

You may get a rsInvalidDataSourceReference error when you try to deploy your custom report into OpsMgr SSRS instance. Everything may look good: you have used the “Data Warehouse Main” data source when you was designing your report in the Visual Studio (BIDS), you have injected your report into your management pack, etc… But the result is still the same: rsInvalidDataSourceReference. SSRS cannot match existing datasource with the one you’re trying to reference.

There are two ways to overcome this:
Option I. You want to fix the issue only for your installation. You don’t care about others. You don’t have many reports.
  1. Open SSRS Report Manager.
  2. Find your report.
  3. Open “Properties” tab
  1. Select “Data Sources” view
  2. Select right shared data source for your “Data Warehouse Main” DS.

Option II. You want everything to be deployed automatically everywhere. You don’t want to fix anything manually as described above.
Okay, in this case you should check a couple of things:
  1. Open your “Data Warehouse Main.rds” and check names and IDs. Or just copy-paste following XML (don’t forget to change connection string):
  2. <?xml version="1.0" encoding="utf-8"?><RptDataSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <Name>Data Warehouse Main</Name>  <DataSourceID>e4235c51-407f-4065-8519-a1e57374bc45</DataSourceID>
      <ConnectionProperties>
        <Extension>SQL</Extension>
        <ConnectString>data source=MyDWServer;initial catalog=OperationsManagerDW;Integrated Security=SSPI</ConnectString>
        <IntegratedSecurity>true</IntegratedSecurity>
      </ConnectionProperties>
    </RptDataSource>
  3. Open you report definition (.rdl) and check data source definition. It should look like this:
  4. <DataSource Name="DataWarehouseMain">
      <rd:DataSourceID>e4235c51-407f-4065-8519-a1e57374bc45</rd:DataSourceID>
      <DataSourceReference>Data Warehouse Main</DataSourceReference>
    </DataSource>
  5. Ensure that all queries are referencing DataWarehouseMain (without spaces).
  6. Re-inject your report(s) into your MP ad redeploy it.
PS: By the way, this trick will not work for Visual Studio’s “Deploy” feature (you may use it for testing purposes). The explanation is pretty simple: DataWarehouseMain data source is automatically adjusted by Microsoft.SystemCenter.DataWarehouse.Deployment.ReportDeployer module during report deployment process. Data source name is used to determine if DS should be adjusted or not (that’s why “Data Warehouse Main” doesn’t work).

Leave a Comment