3

/ReportServer/ 経由でレポートにアクセスするときに、すべての SSRS の既定のエラー ページ (下の図) のブランドを変更 (およびエラー メールを送信) したいと考えています。私はすでに ASP OnError イベントを処理しており、デフォルトの SSRS エラーのいくつかは独自の例外をキャッチしているように見え、このページをレンダリングすると、OnError イベントが発生する前に応答がキャンセルされます。

すべてのエラーページをブランド化するために SSRS をどのように処理できるかについてのアイデアはありますか?

レポート サービス エラー

4

3 に答える 3

1

同様の問題があり、次の解決策を思いつきました。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;
于 2009-09-21T01:40:58.170 に答える
1

SSRS2005 および 2008 用にこのソリューションを作成しました。以下は 2008r2 バージョンです。

reportviewer.aspx で、直前に追加</form>

<script type="text/javascript">
var rptDivString=document.getElementById('ReportViewerControl_ctl10_NonReportContent').innerHTML;
//alert( rptDivString );
var numPermError = rptDivString.search(/permissions/i);
if (numPermError>0)
{
var docTitle = document.title;
var reportName = docTitle.substr(0,docTitle.length-16);
alert('Reporting Services permissions error in report: ' +  reportName );
}
</script>
于 2011-07-20T16:25:45.320 に答える
1

残念ながら、SSRS の視覚的な側面を使用する場合はできません。SOAP および Web サービスを介して直接レポートを使用する場合は可能です。

于 2009-04-26T07:49:55.547 に答える