Je veux être en mesure d'afficher un rapport SQL Server 2005 Reporting Services à partir d'une application ASP.NET dans une zone démilitarisée via un contrôle ReportViewer. Le serveur SQL et SSRS sont derrière le pare-feu.Comment afficher les rapports SQL Server 2005 Reporting Services à partir de ReportViewer Control dans DMZ
Répondre
`J'ai donc dû changer la façon dont une application ASP.NET 2.0 appelée rapports à partir de pages. À l'origine, j'ai utilisé JavaScript pour ouvrir une nouvelle fenêtre.
ViewCostReport.OnClientClick = "window.open('" + Report.GetProjectCostURL(_PromotionID) + "','ProjectCost','resizable=yes')";
La question que j'avais été que l'appel window.open ne fonctionne que dans le réseau client et non sur un nouveau serveur Web situé dans leur zone démilitarisée. J'ai dû créer un nouveau rapport WebForm incorporant un contrôle ReportViewer pour afficher les rapports. L'autre problème que j'avais, c'est que le serveur de rapports devait être accessible avec l'authentification Windows car il était utilisé par une autre application pour les rapports et cette application utilisait des rôles pour l'accès aux rapports. Donc, je suis allé obtenir mon contrôle ReportViewer pour usurper l'identité d'un utilisateur Windows. J'ai trouvé la solution à ceci:
Créer une nouvelle classe qui implémente l'interface Microsoft.Reporting.WebForms.IReportServerCredentials pour accéder aux rapports.
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;
}
}
Ensuite, je crée un événement pour le bouton pour appeler le rapport:
protected void btnReport_Click(object sender, EventArgs e)
{
ReportParameter[] parm = new ReportParameter[1];
parm[0] =new ReportParameter("PromotionID",_PromotionID);
ReportViewer.ShowCredentialPrompts = false;
ReportViewer.ServerReport.ReportServerCredentials = new ReportCredentials("Username", "Password", "Domain");
ReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer.ServerReport.ReportServerUrl = new System.Uri("http://ReportServer/ReportServer");
ReportViewer.ServerReport.ReportPath = "/ReportFolder/ReportName";
ReportViewer.ServerReport.SetParameters(parm);
ReportViewer.ServerReport.Refresh();
}
- 1. SQL Server Reporting Services 2005 - Comment gérer les rapports vides
- 2. Archivage de rapports SQL 2005 Reporting Services
- 3. Licences SQL Server Reporting Services 2005
- 4. SQL Server Reporting Services 2005 - Accessibilité Guidlelines
- 5. SQL Server Reporting Services - Outils de maintenance de rapports
- 6. Lancer les rapports Reporting Services à partir du code .Net
- 7. Police personnalisée dans SQL Server 2005 Reporting Services
- 8. SQL Server 2008 Reporting Services Authentification
- 9. SQL Server Reporting Services 2005 - HTML généré - Conformité aux normes
- 10. Reporting Services 2005 Filter
- 11. Sql Server Reporting services
- 12. rapports changement source de données par script SQL dans les services SQL Server Reporting
- 13. Paramètres d'abonnement dans SQL Server Reporting Services 2005
- 14. ASP.NET MVC et SQL Server Reporting Services
- 15. Comment utiliser WebService de SQL Server 2008 Reporting Services
- 16. SQl 2000 Reporting Services et SQL 2005 Reporting Services côte à côte?
- 17. Capacité d'être administrateur sur SQL Server Reporting Services 2005
- 18. Masquer la grille Gridlines SQL Server Reporting Services 2005
- 19. Liste les rapports avec SQL inline dans SQL Server Reporting Services?
- 20. SQL Reporting Services 2005 - Impression dans FireFox
- 21. Comment afficher l'icône de rapport dans Firefox pour le contrôle Report Viewer SQL Server Reporting Services
- 22. SQL Server Reporting Services, comment appliquer au mieux les filtres
- 23. Comment afficher au mieux les CheckBox dans SQL Server Reporting Services?
- 24. Impossible d'imprimer le rapport à partir de SQL Reporting Services
- 25. Solution de création de rapports Web sans Reporting Services?
- 26. SQL 2008 Reporting Services Authentification
- 27. Optimisation de l'exportation PDF d'énormes rapports dans Sql Reporting Services 2005
- 28. SQL Server Reporting Services 2005 - Comment masquer l'étiquette de légende d'un graphique?
- 29. SQL Reporting Services
- 30. Contrôle de SQL Server 2008 Reporting Services