Après avoir inspecté le JavaScript ReportViewer, je suis venu avec la solution suivante. Il est sujet à casser des choses si Microsoft change cette méthode particulière. Le code suivant serait ajouté à l'en-tête de la page pour vous assurer qu'il court après le javascript ReportViewer est chargé, mais avant une instance de la RSClientController est créée.
// This replaces a method in the ReportViewer javascript. If Microsoft updates
// this particular method, it may cause problems, but that is unlikely to
// happen.The purpose of this is to redirect the user to the error page when
// an error occurs. The ReportViewer.ReportError event is not (always?) raised
// for Remote Async reports
function OnReportFrameLoaded() {
this.m_reportLoaded = true;
this.ShowWaitFrame(false);
if (this.IsAsync)
{
if(this.m_reportObject == null)
{
window.location =
'<%= HttpRuntime.AppDomainAppVirtualPath %>/Error.aspx';
}
else
{
this.m_reportObject.OnFrameVisible();
}
}
}
RSClientController.prototype.OnReportFrameLoaded = OnReportFrameLoaded;
Le code d'origine à partir du fichier de script Microsoft ReportViewer (dans les Microsoft.ReportViewer.WebForms, 8.0.0.0, Net Framework 3.5 SP1) est:
function OnReportFrameLoaded()
{
this.m_reportLoaded = true;
this.ShowWaitFrame(false);
if (this.IsAsync && this.m_reportObject != null)
this.m_reportObject.OnFrameVisible();
}
RSClientController.prototype.OnReportFrameLoaded = OnReportFrameLoaded;
exception ce que vous obtenez? –
erreurs personnalisées générées dans le rapport Sproc, mais cela devrait être hors de propos que je veux traiter ces erreurs, ne pas les résoudre. –