SSRS: the given path's format is not supported

Fri, Mar 16, 2018 2-minute read

As an aside to my other post on SSRS in SharePoint integrated mode, this is a niggly little issue I encountered.

If you find yourself needing to edit a published report and, for whatever reason can’t go back to source to make the change, then a reasonable option is to download a copy of the report from SharePoint and then open it up in your Visual Studio of choice and make the edits. RDL files are pretty great at encapsulating everything they need to run within a single file (they are just XML files, after all) so this is a workable approach.

One other thing that SSRS / RDL files are good at is being able to change a data source at runtime. So you can develop targeting local or an embedded data source, and then when you deploy to SSRS/SP, switch the connection to a shared datasource on the report itself. Nifty.

There’s a caveat here though - that is, if you download a copy of your RDL to then edit, you may find an issue when trying to preview it:

The given path’s format is not supported.

I narrowed this down to the definition of the DataSource element. When you develop locally, you probably target the SQL Server directly using a connection string. But when you deploy, and then switch to a shared datasource (a .rsds file) this itself gets imposed in to the .rdl file. Herein lies the issue - doing it this way (I assume) is not supported in Visual Studio due to security context. Fortunately, it’s easy to fix.

Switch the report to code view (or edit it in a text file), and find the DataSources block; it will be something like this:

<br /> <DataSources><br /> <DataSource Name="MyDataSource"><br /> <DataSourceReference>http://sharepoint/Data Sources/MySharedDataSourceFile.rsds</DataSourceReference><br /> <rd:SecurityType>Integrated</rd:SecurityType><br /> <rd:DataSourceID>ed3d16a4-f103-4f32-8f69-a846ab2a2763</rd:DataSourceID><br /> </DataSource><br /> </DataSources><br />

You should switch this to something that you can access - either a local .rsds file, or, a SQL server directly:

<br /> <DataSources><br /> <DataSource Name="MyDataSource"><br /> <ConnectionProperties><br /> <DataProvider>SQL</DataProvider><br /> <ConnectString>Data Source=mysqlserver;Initial Catalog=dbname</ConnectString><br /> <IntegratedSecurity>true</IntegratedSecurity><br /> </ConnectionProperties><br /> <rd:SecurityType>Integrated</rd:SecurityType><br /> <rd:DataSourceID>ed3d16a4-f103-4f32-8f69-a846ab2a2763</rd:DataSourceID><br /> </DataSource><br /> </DataSources><br />

And with that in place, your report should preview just fine.