Hola de nuevo tengo una consulta, deseo llamar a reporte desde mi ServerReport desde mi proyecto en winform, cuando lo llamo me dice que no tengo autorizacion, tomando en cuenta esto utilizo una clase creada
ReportServerCredentials
public class ReportServerCredentials : IReportServerCredentials
{
private string reportServerUserName;
private string reportServerPassword;
private string reportServerDomain;
public ReportServerCredentials(string userName, string password, string domain)
{
reportServerUserName = userName;
reportServerPassword = password;
reportServerDomain = domain;
}
public WindowsIdentity ImpersonationUser
{
get
{
// Use default identity.
return null;
}
}
public ICredentials NetworkCredentials
{
get
{
// Use default identity.
return new NetworkCredential(reportServerUserName, reportServerPassword, reportServerDomain);
}
}
public void New(string userName, string password, string domain)
{
reportServerUserName = userName;
reportServerPassword = password;
reportServerDomain = domain;
}
public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)
{
// Do not use forms credentials to authenticate.
authCookie = null;
user = null;
password = null;
authority = null;
return false;
}
}
Cuando llamo a mi reporte de la siguiente manera
reportViewer1.ServerReport.ReportServerUrl =new System.Uri("http://192.168.1.1/ReportServer");
IReportServerCredentials irsc = new ReportServerCredentials("Reportes", "ServerMXXX","");
reportViewer1.ServerReport.ReportPath = "http://192.168.1.1/ReportServer/RptMonitoreo/CruceDemo";
reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = irsc;
Me sale un error...
Error 1 Cannot implicitly convert type 'Microsoft.Reporting.WinForms.IReportServerCredentials' to 'System.Net.ICredentials'. An explicit conversion exists (are you missing a cast?)
He buscado alguna solucion como un cast o algun metodo alternativo pero sin ningun resultado espero que me ayuden gracias