【问题标题】:Unable to access ssrs reports from ASP.NET无法从 ASP.NET 访问 ssrs 报告
【发布时间】:2012-06-13 04:22:47
【问题描述】:

我已经在装有 Win 7 和 SQL Server 2008 R2 的机器上部署了 ssrs 报告。我正在尝试从部署在同一台机器上的 ASP.NET 应用程序访问这些报告。我可以从配置工具的 URL 访问报告。但是,当我从已部署的 ASP.NET 应用程序访问相同内容时,它会引发“未经授权”错误。该应用程序是在 Win XP、SQL Server 2008 环境下开发的。我从互联网上注意到了很多可能性。但不知道来了解我从 ASP.NET 应用程序访问报告时缺少什么。

请帮忙。 谢谢

【问题讨论】:

  • 你能详细解释一下实现吗?
  • 请告诉我您需要一些不同的解决方案,或者您的情况不同。

标签: asp.net windows-7 reporting-services sql-server-2008-r2


【解决方案1】:

将此代码放在 Page_Load 事件上并包含使用 Microsoft.Reporting.WebForms;: 报告在不同服务器上时需要远程模式:

 if (!Page.IsPostBack)
        {
            ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            ReportViewer1.ServerReport.ReportServerUrl = new Uri(rptServerUrl);
            ReportViewer1.ServerReport.ReportPath ="Exact Report Path Here";
            ReportViewer1.ServerReport.ReportServerCredentials = new ReportViewerCredentials(userId, password, domain);
        }`

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多