SSRS REPORTS ERROR WHEN LARGE NUMBER OF PARAMETERS ARE PASSED

Today we will be talking about a nasty error message that you may encounter when running certain SSRS reports that have a big list of multi choices parameters or a lot of parameters. That error message will might say something like Operation is not valid due to the current state of the object or in my case there was NO error message at all. This was caused by a security fix released by Microsoft under Security Bulletin MS11-100. The fix limit the number of keys that ASP.NET applications can parse as part of a request and that will block the large number of parameters and not letting the end user to run the SSRS reports. The solution for this issue is to add a section in your web.config file inside the <appsettings/> section

1
2
3
4
5
<appSettings>
    ...
    <add key="aspnet:MaxHttpCollectionKeys" value="9999" />
    ...
</appSettings>

That 9999 value should represent the number of parameters that you believe it will be used. Now where you can find this web.config file? If using SharePoint integration Mode: It’s located on the web server and has the path C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config But you have to keep on mind if there is more than one SharePoint instance and what instance are you using to deploy the reports, of example the path can be C:\inetpub\wwwroot\wss\VirtualDirectories\EPMA\web.config If using SSRS native Mode: The web.config file will be located at your SQL server and it will have the path: C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer. Now to see the results we have one more thing to do, in case of editing web.config of SharePoint Integration Mode you have to do IIS reset, in case of editing web.config of SSRS native mode then you will have to restart you SSRS Service.