Custom error pages for SSRS 2016

  • Hi all

    I thought I'd asked this before, but couldn't find it.

    I want to get around the basic "Your report failed" type errors with a custom error page based on what the error is.
    I found a link (clicky) and I've added in the CustomErrors section into web.config file.

    The top of the web.config file currently looks like this:-
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <system.web>
        <customErrors mode="on" defaultRedirect="/CustomerErrorPages/error.html">
             <error statusCode="403" redirect="/CustomerErrorPages/accessdenied.html" />
             <error statusCode="404" redirect="/CustomerErrorPages/pagenotfound.html" />
        </customErrors>
      <pages validateRequest="false">
      <controls>
       <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
      <namespaces>
       <remove namespace="System.Linq" />
       <remove namespace="System.ComponentModel.DataAnnotations" />
      </namespaces>
      </pages>

    There's a lot more below that, this is just the (hopefully) relevant bit.

    I then restarted the SQL Server Reporting Services service on the server.

    Unfortunately it's not working, I just get the usual error messages.

    My guess is it's my understanding of how the errors are generated. that's flawed.

    Now I have 2 questions:-
    1) Is it possible to have custom error pages for SSRS reports?
    2) If so, am I going about this the right way or completely wrong?

    Any help on this would be greatly appreciated.

  • Hi all

    Thought I'd resurrect this thread as I'm still struggling with this.
    We are using:-
    SQL Server 2016
    Microsoft SQL Server Reporting Services Version 13.0.5201.2

    I've been into Advanced settings for SSRS on the server and set Enable Remote Errors to true and made sure the error.html file is where it's supposed to be according to this section from web.config:-

    <customErrors mode="On" defaultRedirect="C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\CustomerErrorPages\error.html">
      <error statusCode="403" redirect="C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\CustomerErrorPages/accessdenied.html" />
      <error statusCode="404" redirect="C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\CustomerErrorPages/pagenotfound.html" />
      </customErrors>

    If I double-click on the error.html file, it displays as a web-page as you would expect.

    Any help would be greatly appreciated.

    If you need any more info, feel free to ask.

    Regards

    Richard

    ::edit::
    We don't appear to have IIS installed on the server if that makes a difference.

  • Hi all

    The issue looks to be because we use custom security.
    Assuming the user does not have access tot he report, we use :-
    THROW 51000, 'You do not have permission to view this report!', 1;
    to stop the report from running.

    Is there any way of capturing that within the report and redirecting to a URL?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply