同様の問題があり、次の解決策を思いつきました。Microsoft がこの特定の方法を変更すると、問題が発生する傾向があります。次のコードをページのヘッダーに追加して、ReportViewer JavaScript がロードされた後、RSClientController のインスタンスが作成される前にページが実行されるようにします。
// 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;
Microsoft ReportViewer スクリプト ファイル (Microsoft.ReportViewer.WebForms、8.0.0.0、.Net Framework 3.5 SP1 内) の元のコードは次のとおりです。
function OnReportFrameLoaded()
{
this.m_reportLoaded = true;
this.ShowWaitFrame(false);
if (this.IsAsync && this.m_reportObject != null)
this.m_reportObject.OnFrameVisible();
}
RSClientController.prototype.OnReportFrameLoaded = OnReportFrameLoaded;