Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the ReportingService2005 API to get the datasource used by a particular report.</p> <p>You need the full path of the report (which I assume you have), and then use it to query the reporting service for its data source (<a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.getitemdatasources(SQL.90).aspx" rel="nofollow noreferrer">API</a>).</p> <pre><code>// rs = ReportingService2005 that you need to set up. DataSource ds; DataSources dataSources = rs.GetItemDataSources(item); // item is a string containing the full path to the report. dataSources = rs.GetItemDataSources(item); ds = dataSources[0]; </code></pre> <p>The ds in the code above is either a <a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.datasourcedefinition.connectstring(SQL.90).aspx" rel="nofollow noreferrer">DataSourceDefinition</a> or a <a href="http://msdn.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.datasourcereference(SQL.90).aspx" rel="nofollow noreferrer">DataSourceReference</a>. If it's a definition you can just cast it into that type and then get the connection string using the following code.</p> <pre><code>DataSourceDefinition dsd = ds as DataSourceDefinition(); if(dsd == null) throw new Exception(); String connectionString = dsd.ConnectString; </code></pre> <p>If it's a datasourcereference you need to check out the <a href="http://msdn.microsoft.com/en-us/library/ms159728(SQL.90).aspx" rel="nofollow noreferrer">API</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload