0

Afficher un serveur de rapports central exécutant SSRS, tous nos rapports sont déjà créés et présents sur le serveur. Comment puis-je maintenant afficher un de ces rapports en utilisant ReportViewer Contontrol dans ASP.NET?Afficher le rapport SSRS dans le contrôle ReportViewer

Mon contrôle:

Mon CodeBehind:

var reportServer = ctReportViewer.ServerReport; 
     reportServer.ReportServerUrl = new Uri(@"http://<MYSERVERNAMEHERE>/reportsdev"); 
     reportServer.ReportPath = @"/OneFm/ArrearCollectionPerRegion"; 
     reportServer.ReportServerCredentials = new ReportViewerCredentials("<USERNAME>", "<PASSWORD>", "<DOMAIN>"); 
     ctReportViewer.DataBind(); 

public partial class ReportViewerCredentials : IReportServerCredentials 
    { 
     private string _userName; 
     private string _password; 
     private string _domain; 

     public ReportViewerCredentials(string userName, string password, string domain) 
     { 
      _userName = userName; 
      _password = password; 
      _domain = domain; 

     } 


     public WindowsIdentity ImpersonationUser 
     { 
      get 
      { 
       return null; 
      } 
     } 

     public ICredentials NetworkCredentials 
     { 
      get 
      { 

       return new NetworkCredential(_userName, _password, _domain); 

      } 
     } 

     public bool GetFormsCredentials(out Cookie authCookie, 
       out string userName, out string password, 
       out string authority) 
     { 
      authCookie = null; 
      userName = _userName; 
      password = _password; 
      authority = _domain; 

      // Not using form credentials 
      return false; 
     } 
    } 

Lien vers le rapport:

http://<MYSERVERNAMEHERE>/ReportsDev/Pages/Report.aspx?ItemPath=/OneFm/ArrearCollectionPerRegion 

J'ai cherché haut et bas. Je suis en cours d'exécution SSRS2005, et j'utilise VS2008 si cela compte pour quoi que ce soit.

Un exemple serait vraiment apprécié.

Répondre

0

a réussi à le comprendre Thanx:

 var reportName = "SalesTargets" 
     ctReportViewer.ServerReport.ReportServerUrl = new Uri("http://<MYREPORTSERVER>/reportserverdev"); 
     ctReportViewer.ServerReport.ReportPath = @"/OneFm/" + reportName; 
     ctReportViewer.ProcessingMode = ProcessingMode.Remote; 
     ctReportViewer.ServerReport.Refresh(); 
     ctReportViewer.AsyncRendering = false; 
     ctReportViewer.SizeToReportContent = true; 
Questions connexes