Resolving the Maximum Request Length Exceeded Exception in SQL Server Reporting Services


By:   |   Updated: 2017-02-07   |   Comments (5)   |   Related: > Reporting Services Development


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.



Last Updated: 2017-02-07


get scripts

next tip button



About the author
MSSQLTips author Dallas Snider Dr. Dallas Snider is an Assistant Professor in the Computer Science Department at the University of West Florida and has 18+ years of SQL experience.

View all my tips





Comments For This Article




Wednesday, March 20, 2019 - 6:36:03 AM - Balaji Back To Top (79342)

Hi Dr Dallas Snider,

Your article is really very clear and helpful. Thank you so much for that !!


Thursday, July 26, 2018 - 11:18:59 PM - Venkata D R Back To Top (76842)

Thank you Dr. Dallas Snider, very helpful post indeed


Thursday, July 26, 2018 - 11:17:25 PM - Venkata D R Back To Top (76841)

Karel , you are correct:

https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength(v=vs.110).aspx

**************************************

Property Value

Type: System.Int32

The maximum request size in kilobytes. The default size is 4096 KB (4 MB).

**************************************


Tuesday, July 03, 2018 - 4:52:16 AM - Karel Kohout Back To Top (76511)

A value for maxRequestLength is in kilobytes! For 8 MB limit you should set maxRequestLength="8192".

8388608 means 8 GB and this is invalid value for maxRequestLength.


Friday, August 18, 2017 - 10:53:42 AM - Rob Volpe Back To Top (64998)

Dr. Snyder - Thank you!!  This tip was invaluable to a small work dillemma I was facing.  Keep up the good work... and thanks so much again!

 

Rob Volpe

 

 



download





Recommended Reading

SQL Server Reporting Services Using Multi-value Parameters

Multiple Row Grouping Levels in SSRS Report

SSRS Trending Report Example

Cross Tab Report in SSRS

SQL Server Reporting Services Reusable Code Blocks








get free sql tips
agree to terms


Learn more about SQL Server tools