Navigating SSRS reports in prior versions of SQL Server

Recently, I created an application that navigates SSRS reports. I’m developing against SQL 2008 R2, so my instructions were specific to that platform.

If you are not yet on R2, you can still develop such an application. Here’s what you’ll need to do differently.

Use the ReportService2005.asmx endpoint
In my example, I used the ReportService2010.asmx endpoint to access report service methods. If you are not on R2, that will give you the error:

The path of the item 'wsdl' is not valid.

You might try ReportService2006.asmx. But if you do, you will probably run up against this:

This operation is not supported on a report server that runs in native mode

The answer (thank you Tristan Fernando) is to use ReportService2005.asmx. Follow the instructions in my previous post, but replace the endpoint.

Use the Type enum to identify catalog items
My previous example used the TypeName string property to differentiate between folders and reports. ReportService2005.asmx uses an enum property called Type instead. Enums are safer than magic strings anyway.

Don’t use DefaultCredentials
This change is not related to R2. It’s just something I got wrong at first. If you are using Forms authentication, like I am, then DefaultCredentials won’t work for you. I set ReportingService2010.Credentials to CredentialCache.DefaultCredentials in my last example. It worked for me only because the app happened to be running under my own account.

Instead, create a NetworkCredential using the password that you captured during login. Use the code from Forward network credentials to Report Server to capture and encrypt the password.

Leave a Reply

You must be logged in to post a comment.