이 link이 도움이되는지 확인하십시오. 또는 다음과 같이 시도하십시오.
internal class ReportCredentials : IReportServerCredentials
{
private string strUserName;
private string strPassword;
private string strDomain;
public ReportCredentials(string strUserName, string strPassword, string strDomain)
{
this.strUserName = strUserName;
this.strPassword = strPassword;
this.strDomain = strDomain;
}
public System.Security.Principal.WindowsIdentity ImpersonationUser
{
get { return null; }
}
public ICredentials NetworkCredentials
{
get { return new NetworkCredential(strUserName, strPassword, strDomain); }
}
public bool GetFormsCredentials(out Cookie authCookie, out string user,
out string password, out string authority)
{
authCookie = null;
user = password = authority = null;
return false;
}
}
이
string strUserName = ConfigurationManager.AppSettings["userName"].ToString();
string strPassword = ConfigurationManager.AppSettings["password"].ToString();
string strDomain = ConfigurationManager.AppSettings["domain"].ToString();
ReportViewer1.ServerReport.ReportServerCredentials = new ReportCredentials(strUserName, strPassword, strDomain);