Report Viewer error: The request failed with HTTP status 401: Unauthorized

asp.netreportreportviewerSecurity

I have a asp.net c# web application with contains reports in remote processing mode. I am using the report-viewer control to render the reports. When I run the application in debug mode, I'm able to view my reports however when I publish the application to a different server I get this error message:

The request failed with HTTP status 401: Unauthorized.

My report server is on a different server than the location of my published web application. I have added new role assignment to my report server and also added to my web.config but the error persists. I think I am missing something in my aspx page for reportviewer.

Any input would be appreciated.

Best Answer

I'm assuming you already have set the server in your codebehind such as this

reportviewer.ServerReport.ReportServerUrl = "http://{server_ip}/reportserver";

or via the properties of the report viewer control. Make sure you change {server_ip} to the actual for the report server.

Other such problems I've seen in the past have to do with access for individual reports. Since this is cross-server, you'll need a proxy user set to view the reports.

Here are 2 examples from MSDN:

Example 1

Example 2

Related Topic