ServerReport.ReportServerCredentials provided to a ReportViewer yields an HTTP 401 Unauthorized error RRS feed

  • Question

  • All:

    I have a VS.Net 2005 solution that uses a ReportViewer control to pass credentials for report viewing for our clients. This works already in our production environment using Windows Server 2003, and SQL Server SRSS 2005. It also works on a development server running Windows Server 2003 and SQL Server SSRS 2008 R2.

    Where it's not working is: A new machine running Windows Server 2008, and SQL Server SSRS 2008 R2.

    Here is a description of what's happening:

     // This section of code appears to be working.
     // I'm certain this section of code is working, because I used a different set of valid credentials for this one and it worked
     ProductionSSRSRef2008.ReportingService2005 rs = new ProductionSSRSRef2008.ReportingService2005();
     rs.Url = "http://(omitted for security)/reportserver/reportservice2005.asmx";
     NetworkCredential nc = new NetworkCredential("(omitted for security)", "(omitted for security)", "(omitted for security)");
     rs.Credentials = nc;
     bool forRendering = false;
     string historyID = null;
     ProductionSSRSRef2008.ParameterValue[] parameterValues = null;
     ProductionSSRSRef2008.DataSourceCredentials[] dsCredentials = null;
     ProductionSSRSRef2008.ReportParameter[] parameters = null;
     // This section of the code is the one that appears to be failing
     myReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
     myReportViewer.ServerReport.ReportServerCredentials = new ReportServerNetworkCredentials(serverName);

     calling this class: public sealed class ReportServerNetworkCredentials : IReportServerCredentials
         else if (applicationLocation == "")
      userName = "(omitted for security)";
      domainName = "(omitted for security)";
      password = "(omitted for security)";

     The user credentials I'm using are valid, if I use them to directly to a report it works just fine. I have also added this user to the appropriate SQL groups in Windows User Management.
     The error message I get is:
     The request failed with HTTP status 401: Unauthorized.
            // A review of the Windows Security Logs reveals that the login is failing so:
     Security ID:  NULL SID
     Account Name:  SQLReportUser
     Account Domain:  (omitted for security)

    Friday, August 20, 2010 5:49 PM