Custom Error Pages in Reporting Services 2008

I would like to re-mark (and send error messages) for all SSRS error error pages (Figure below) when accessing reports via / ReportServer /. I am already handling the ASP OnError event, and some of the default SSRS errors seem to catch their own exceptions, and then render this page, canceling the response before the OnError event is fired.

Any idea on how I can get a handle in SSRS to mark all error pages?

Reporting Services Error

+3
source share
3 answers

Unfortunately, you cannot use the visual aspects of SSRS. You can if you use reports directly through SOAP and the web service.

+1

, . , Microsoft . , , JavaScript- ReportViewer, 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 script ( 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;
+1

SSRS2005 2008. 2008r2

in reportviewer.aspx, add right before </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>
+1
source

Source: https://habr.com/ru/post/1698106/


All Articles