【问题标题】:The request failed with HTTP status 401: Unauthorized. SSRS请求失败,HTTP 状态为 401:未授权。 SSRS
【发布时间】:2014-12-04 11:22:12
【问题描述】:

我在处理 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 :(

【问题讨论】:

    标签: reporting-services


    【解决方案1】:

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

    【讨论】:

    • 本地帐户 + NLB = 可预测的故障。使用域帐户访问虚拟服务器名称,或者如果您要使用本地帐户在本地机器上运行任务,则配置主机条目,以便虚拟服务器名称独占使用本地计算机。 NLB 通常按 IP 地址缓存路由(不是纯循环平衡),这可能导致“但本地帐户有时工作”的情况。但是,如果您被路由到 NLB 中的其他节点,则本地帐户将失败。 stackoverflow.com/a/32119709/4051367
    • 我同意你的看法。我提供了一个可以让用户启动并运行的解决方案。该操作员没有具体说明他将如何远程访问服务器或网络的命名法。我希望如果正在使用域控制器,那么该帐户将是首选。创建本地帐户将是解决帐户问题的一种快速方法,而不是最具可扩展性的方法。
    猜你喜欢
    • 2012-11-27
    • 1970-01-01
    • 1970-01-01
    • 2011-03-18
    • 2012-06-30
    • 2013-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多