Vous devez coder les informations d'identification dans le contrôle ReportViewer. Jetez un oeil à la classe suivante:
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;
}
}
Vous voulez dire que la page aspx héberge reportViewer? pourquoi ne pas mettre des informations d'identification sur la même page? – Dewfy
lorsque le rapport est ouvert, demandant l'ID utilisateur et le mot de passe? –
vous ne pouvez pas ouvrir le site si vous ne fournissez pas les informations d'identification – agnieszka