2

I have a class in a MVC web project that processes SSRS. When I run the app in the IIS machine I access the reports OK. When run from another machine on the network gives me "The request failed with HTTP status 401: Unauthorized." The Report Server has own unique credentiais. Does not accept the logon credentials on the network

Annex a part of the class

reportViewer.ProcessingMode = ProcessingMode.Remote;
reportViewer.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationManager.AppSettings["RSUrl"]);
reportViewer.PromptAreaCollapsed = true;
reportViewer.ShowParameterPrompts = false;
reportViewer.SizeToReportContent = true;
reportViewer.InteractivityPostBackMode = InteractivityPostBackMode.AlwaysAsynchronous;
reportViewer.AsyncRendering = false;

if (reportType == "GRP")
{
    reportViewer.ShowToolBar = false;
    reportViewer.ShowPageNavigationControls = false;
}
else //if (reportType == "RPT")
{
    reportViewer.ShowToolBar = true;
    reportViewer.ShowPageNavigationControls = true;
}

strReportName = _reqObjNm;
strReportPath = System.Configuration.ConfigurationManager.AppSettings["RSPath"];
reportViewer.ServerReport.ReportPath = strReportPath + strReportName;

string RSUsername = System.Configuration.ConfigurationManager.AppSettings["RSUserName"];
string RSPwd = System.Configuration.ConfigurationManager.AppSettings["RSPwd"];
string RSDomain = System.Configuration.ConfigurationManager.AppSettings["RSDomainFull"];

//App_Start.ReportViewerCredentials rvCreds = new App_Start.ReportViewerCredentials(RSUsername, RSPwd, RSDomain);
//reportViewer.ServerReport.ReportServerCredentials = rvCreds;

reportViewer.Visible = true;
if (reportViewer.ServerReport.GetParameters().Count > 0)  // HERE breaks :(
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
AOC
  • 23
  • 1
  • 5

1 Answers1

1

If I understand your question correctly I think you need to add a "ReportUser" to the remote SSRS server as a local user and in SSRS manager grant the local "ReportUser" user account proper access.

Ross Bush
  • 14,648
  • 2
  • 32
  • 55
  • Local accounts + NLB = predictable failure. Either use the domain account to access the virtual server name, or if you're going to run tasks on the local boxes with local accounts, then configure a hosts entry so the virtual server name uses the local machine exclusively. NLBs often cache routes by IP address (not pure round robin balancing) which can lead to 'but the local account works sometimes' scenario. But if you're routed to the other nodes in the NLB the local account will fail. http://stackoverflow.com/a/32119709/4051367 – Kiquenet Sep 17 '15 at 17:45
  • I agree with you. I gave a solution that would get the user up and running. The op did not specify how he was to access the server remotely or the nomenclature of the network. I would expect that if a domain controller is being used then that account would be preferred. Creating a local account would be a quick way to troubleshoot account issues, not necessary the most scalable. – Ross Bush Sep 17 '15 at 17:52