views:

32

answers:

0

I am writing something to get a report back and email it using SSRS' url interface.

The code is simple:

var string reportURI = 
            "http://ReportServer/Pages/ReportViewer.aspx?/ReportNsmrs&rs:Command=Render&rs:Format=PDF";
var webRequest =    HttpWebRequest.Create(reportURI);                                    
        webRequest.Credentials = CredentialCache.DefaultCredentials;            
        return webRequest.GetResponse();

However if I put the wrong report name in A web exception is raised with a response status of 500.

"The remote server returned an error: (500) Internal Server Error."

This error is ambiguous to say the least.

When I put the bad reportname request into a web browser I get a lovely web page telling me that :

The item 'ReportName' cannot be found. (rsItemNotFound)

I can obviously handle the error and search the response for rsItemnotFound but this seems overly complex. Is there any other way I can get the rsItemNotFound message through the http api?