Search code examples
powershellsharepointreporting-servicessharepoint-2010

SSRS 2008 R2 Correct Generation of .rsds for SharePoint


I've put together a PowerShell script to deploy some reports and corresponding datasets and datasources as well as link the embedded dataset references to the shared datasets but getting stuck at specifying the shared datasource for the shared dataset.

So initially I had to rename the .rds to .rsds for it to show up as a selectable datasource via the SharePoint UI. I'm getting an error though when I programmatically or manually via the UI set the DataSource for the DataSet saying the schema is wrong. So I've tried running the Build->Deploy from BIDS and then downloaded the .rsds to see the difference. Turns out the BIDS version which is what gets built looks like this:

<?xml....?>
<RptDataSource...>
  <ConnectionProperties>
    <Extension>SHAREPOINTLIST</Extension>
    <ConnectionString>...my sharepoint site url...</ConnectionString>
    <IntegratedSecurity>true<IntegratedSecurity>
  </ConnectionProperties>
  <DataSourceID>...some guid...</DataSourceID>
<RptDataSource>

whereas BIDS generates this for SharePoint when doing Build->Deploy

<?xml....?>
<DataSourceDefinition>
  <Extension>SHAREPOINTLIST</Extension>
  <ConnectionString>...my sharepoint site url...</ConnectionString>
  <CredentialRetrieval>Integrated</CredentialRetrieval>
  <Enabled>True</Enabled>
</DataSourceDefinition>

So, is there a built in way (either in BIDS or an existing PowerShell module/script) to get this generated when building locally rather than running a Deploy or am I going to have to run some xslt to transform it (Or just copy an existing source file and replace the connection string as it's the only thing that matters) and rename as a post build process?


Solution

  • Roighto! I found that there's a way to create a datasource via the ReportingServices2010.asmx service. Using that and ignoring the .rds written when building the project in BIDS.