I'm using HttpWebRequest to programatically export an SSRS 2008 report in PDF format. My problem however, is my NetworkCredentials don't seem to be working. I'm receiving an Unauthorized (401) error when trying access SSRS.
I know the NetworkCredentials I supplied are correct. If I log into our SSRS web service manually, these are the exact credentials I use. Also, this works fine locally, just not up on our server.
The report is run on our asp.net 4.0 website. When the user clicks the "Generate Report" button, the following code is executed (the error occurs on my 2nd line, on WebRequest.Create) to try to connect to my SSRS 2008:
string sTargetURL = "MY_REPORT_SERVER?/REPORT_NAME&rs:format=pdf&rs:command=render&rc:parameters=Collapsed";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sTargetURL);
req.PreAuthenticate = true; req.Credentials = new NetworkCredential("Username", "P ...
Go to the complete details ...