请求失败,HTTP状态为401:未授权。 SSRS

时间:2014-12-04 11:22:13

标签: reporting-services

我在处理SSRS的MVC Web项目中有一个类。 当我在IIS计算机上运行应用程序时,我可以访问报告。 当从网络上的另一台机器运行时,我发现请求失败,HTTP状态为401:未经授权。" 报表服务器具有自己唯一的凭据。不接受网络上的登录凭据

附件类的一部分

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 :(

1 个答案:

答案 0 :(得分:1)

如果我正确理解您的问题,我认为您需要添加" ReportUser"远程SSRS服务器作为本地用户,并在SSRS管理器中授予本地" ReportUser"用户帐户正确访问。