Resolving the Maximum Request Length Exceeded Exception in SSRS

Problem

When deploying a report in SQL Server Reporting Services, I am receiving an exception error stating “Maximum request length exceeded” as shown below. How do I resolve this?

Error message in Visual Studio

Solution

By default, the maximum file size that can be deployed to SQL Server Reporting Services is 4 megabytes. In this tip we will walk through the steps on how to resolve this exception error. The examples shown here are on Windows 10 using SQL Server 2016.

The first step is to go to the directory holding the Report Definition Language (*.rdl) files to examine the size of the files we are attempting to deploy. Notice the highlighted file exceeds 4 MB so we know we are on the right track. This particular report file has an ESRI map embedded in it.

RDL file sizes

The second step requires us to edit the web.config file for the ReportServer. Go to the ReportServer sub-directory where SQL Server Reporting Services is installed. In this example, the path to the ReportServer directory is C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer.

Report Server Directory

Make a backup copy of the web.config file.

Backup the web.config file

Open the web.config file with a text editor such as Notepad. If Visual Studio is installed, double-clicking on web.config should open the file in Visual Studio.

Edit the web.config file

Search the web.config file for httpRunTime.

Search for httpRuntime

Add maxRequestLength with a file size in bytes. In this example we are setting the maxRequestLength to 8388608 which is 8 MB. Save the web.config file.

add maxRequestLength

The changes to the web.config file do not become effective until Reporting Services is restarted. We can restart the service through the Reporting Services Configuration Manager, the Services application, or by rebooting.

To restart the service through the Reporting Services Configuration Manager, start the Reporting Services Configuration Manager.

Start the Reporting Services Configuration Manager

Connect to the server.

Connect to the server

Stop the service.

Stop the service

Start the service. After the service has started the changes should be in place.

Start the service

To restart Reporting Services through the Services application, scroll down to SQL Server Reporting Services, right click and then select restart.

Restart through the services application

Deploy the report(s) again from Visual Studio.

Deploy the report again

This time the deployment was successful.

Successful deployment

Next Steps

Please make sure that your report renders correctly in the SQL Server Reporting Services Web Portal. Also, please check out the following tips on www.mssqltips.com.

One comment

  1. This could be helpful if you provided the means by which you viewed the size of the RDL files. Which are not really files on a drive but files in a blob. I have been searching the web for almost an hour (huge waste of my time)
    Ho did you get that listing of files and their sizes?

Leave a Reply

Your email address will not be published. Required fields are marked *