Last post Oct 09, 2012 04:37 AM by savvy
Oct 08, 2012 11:39 AM|savvy|LINK
I am using Visual Studio 2010 SP1, .Net 4.0, SSRS 2008 R2, Windows XP Professional
The following is the error I am getting, when I am trying to run reports using Visual Studio 2010 (debug mode) on my development machine.
The request failed with HTTP status 401: Unauthorized.
The web.config has settings:
<authentication mode="Windows" />
<identity impersonate="true" />
I have set up a class for WindowsImpersonationCredentials : IReportServerCredentials
Checked the ServerReport.ReportServerCredentials before running the report and it has the user ID who is logged into the machine, but
ServerReport.ReportServerCredentials.ImpersonateUser is null just before running the report.
The web application and the SSRS are on the same development machine.
Changed the DisableloopCheck to 1 in the registry didn't make any difference.
The report works fine when I run it directly from the report manager.
The same code works fine on the server suprsingly but not my local machine (debug mode)
Couldn't figure out what on earth is going on behind the scenes. Any help would be really appreciated.
Oct 09, 2012 02:25 AM|Srikanth Kasturi|LINK
First question, how are you finding out the current user in your application ? Http Current Context ? Please can you share that line ?
Oct 09, 2012 04:37 AM|savvy|LINK
Thanks for your reply.
The username, password and domain are hardcoded and stored in the web.config as follows and passed onto to ReportServerConnection.NetworkCredentials method.
<add key="ReportViewerServerConnection" value=" App_Code.ReportServerConnection, App_Code"/>
<add key="ReportViewerUser" value="username1"/>
<!-- Used as the user name by the ReportServerConnection class. -->
<add key="ReportViewerPassword" value="password1"/>
<!-- Used as the password by the ReportServerConnection class. -->
<add key="ReportViewerDomain" value="domainName"/>
<!-- Used as the domain by the ReportServerConnection class. -->
<add key="ReportServerUrl" value="http://localhost:90/reportserver"/>