硬编码reporting services凭据以查看asp.net站点上的报告,而无需提示

硬编码reporting services凭据以查看asp.net站点上的报告,而无需提示,asp.net,rdl,Asp.net,Rdl,我可以提供用于查看某些报告的凭据吗?它是在asp.net网站上的reportViewer控件中查看的.rdl报表。您需要将凭据编码到reportViewer控件中。看看下面的课程: public class ReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials { string _userName, _password, _domain; public Re

我可以提供用于查看某些报告的凭据吗?它是在asp.net网站上的reportViewer控件中查看的.rdl报表。

您需要将凭据编码到reportViewer控件中。看看下面的课程:

   public class ReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials
    {
        string _userName, _password, _domain;
        public ReportCredentials(string userName, string password, string domain)
        {
            _userName = userName;
            _password = password;
            _domain = domain;
        }



        public System.Security.Principal.WindowsIdentity ImpersonationUser
    {
        get
        {
            return null;
        }
    }


    public System.Net.ICredentials NetworkCredentials
    {
        get
        {
         return new System.Net.NetworkCredential(_userName, _password, _domain);
        }
    }


    public bool GetFormsCredentials(out System.Net.Cookie authCoki, out string userName, out string password, out string authority)
    {
        userName = _userName;
        password = _password;
        authority = _domain;
        authCoki = new System.Net.Cookie(".ASPXAUTH", ".ASPXAUTH", "/", "Domain");
        return true;
    }
}

你是说aspx页面主机reportViewer?为什么不将凭据放在同一页上?当报表打开时,询问用户id和密码?如果不提供凭据,则无法打开站点