【问题标题】:SSRS Report Permiision Denied after Deploying to the Live Server部署到 Live Server 后 SSRS 报告权限被拒绝
【发布时间】:2014-08-29 06:38:08
【问题描述】:

我有一个关于 SSRS 身份验证的问题。我已经在实时服务器上部署了我的报告,在我使用实时 URL 访问这些报告后,它显示“身份验证失败”错误。我的目的是让宇宙中的任何人都可以访问这些报告,但我该怎么做呢?即让每个人访问该特定 URL 以查看报告。 我在这里使用 SQL Server 身份验证。

当我在本地服务器上运行该应用程序时,它运行良好,因为它有权访问该报告,但是当我尝试访问放置在实时服务器上的报告时,故事就开始了。

提前致谢

【问题讨论】:

    标签: asp.net reporting-services ssrs-2008 ssrs-2008-r2


    【解决方案1】:

    如果你想让公众指责你的报告,你需要使用报告查看器控件,而不是一个很长的过程,让公众可以访问报告服务器。所以很简单,为什么。

    1. 创建新页面和表单标签过去的波纹管代码

      <rsweb:ReportViewer ID="MainReportViewer" runat="server" BackColor="White" 
                      Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos=" (Collection)" 
                      ProcessingMode="Remote" ShowBackButton="False" ShowFindControls="False" 
                      ShowPageNavigationControls="False" SizeToReportContent="True" 
                      ToolBarItemBorderColor="White" ToolBarItemHoverBackColor="White" 
                      WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
                      <ServerReport 
                          ReportServerUrl="" />
                  </rsweb:ReportViewer> 
      
    2. 下面的代码帮助你设置你的报告路径、用户名、密码等,这有助于控告你的报告,请将下面的代码粘贴到 CA 文件中

      protected void Page_Init(Object sender, EventArgs e) {

          string UserName = ConfigurationManager.AppSettings["SsrsUserName"];
          string Password = ConfigurationManager.AppSettings["SsrsPassword"];
          string Domain = ConfigurationManager.AppSettings["SsrsDomain"];
          string ReportServerRoot = ConfigurationManager.AppSettings["SsrsServerRoot"];
          string ReportServerPath = ConfigurationManager.AppSettings["SsrsReportServerPath"];
      
          MainReportViewer.ProcessingMode = ProcessingMode.Remote;
          IReportServerCredentials irsc = new CustomReportCredentials(UserName, Password, Domain);
          MainReportViewer.ServerReport.ReportServerCredentials = irsc;
          MainReportViewer.ServerReport.ReportServerUrl = new Uri(ReportServerRoot);
          MainReportViewer.ServerReport.ReportPath = ReportServerPath + "YourReportFileName";
      

      }

    【讨论】:

    • CustomReportCredentials 函数出现错误,请放置 CustomReportCredentials 的代码...分散等待
    • 请将您的错误信息发送给我,因为如果您为该用户名授予正确的报告权限就可以了。上面的代码可以正常工作。
    • 亲爱的 Beruk.Behane 抱歉迟到了 CustomReportCredentials() 当我写这行 IReportServerCredentials irsc = new CustomReportCredentials(UserName, Password, Domain);它说 CustomReportCredentials 在当前上下文中不存在 ....
    【解决方案2】:

    抱歉延迟回复。请找到 customreportcredentials 类:- 公共类 CustomReportCredentials:Microsoft.Reporting.WebForms.IReportServerCredentials { 私有字符串_用户名; 私有字符串_PassWord; 私有字符串_域名;

        public CustomReportCredentials(string UserName, string PassWord, string DomainName)
        {
            _UserName = UserName;
            _PassWord = PassWord;
            _DomainName = DomainName;
        }
        public CustomReportCredentials(string UserName, string PassWord)
        {
            _UserName = UserName;
            _PassWord = PassWord;
        }
        public System.Security.Principal.WindowsIdentity ImpersonationUser
        {
            get { return null; }
        }
    
        public ICredentials NetworkCredentials
        {
            get { return new NetworkCredential(_UserName, _PassWord, _DomainName); }
        }
    
        public bool GetFormsCredentials(out Cookie authCookie, out string user,
         out string password, out string authority)
        {
            authCookie = null;
            user = password = authority = null;
            return false;
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-03
      • 2014-07-02
      相关资源
      最近更新 更多