ReportViewer control with SSRS 2012 in SharePoint Integrated mode throws rsExecutionNotFound exception

With ReportViewer control, you could do wonders towards your reporting capabilities within your windows and web applications. Recently I had an interesting scenario to work with.

We have an ASP.NET web page with ReportViewer control pulling server side reports from Reporting services 2012 which is in SharePoint integrated mode. If you’ve a doubt on whether ReportViewer supports reporting services that is in SharePoint integrated mode, the answer is a clear YES. You could refer https://msdn.microsoft.com/en-us/library/ms252104.aspx for more details.

In our case, everything was working fine as expected. When you leave the page idle for 10 minutes and perform any operation on the port, it will fail with rsExecutionNotFound exception. You’ve to close the page and reopen it to have the report back.

The same architecture was working fine as expected till SSRS 2008 R2. ReportViewer control normally make sure that the session within the reporting service is kept alive till the browser window is open.

Report viewer control keeps the report session alive by pinging the server periodically for every N-1 second, where N being the timeout of the session set within Reporting Service. By default, the session timeout for SSRS is 600 seconds which is 10 minutes.

Because of this, in the Report Server, the report session has already expired in the 10th minute and hence whenever we access the page after 10 minutes, we get the rsExecutionNotFound exception.

While doing further investigation with the help of Fiddler, I realized that the session keep alive request is being sent by ReportViewer only at the 19th minute instead of the 9th minute. (10 – 1 second).

While investigating the fiddler traffic I realized that the KeepAliveIntervalSeconds being sent by the server is 1140 seconds which is equal to 19 minutes. This made me to wonder from where the 20 minutes session timeout being picked up.

Then I realized that SSRS 2012 in SharePoint integrated mode has a complete different architecture when compared with its predecessors. SSRS 2012 runs as a Shared Service within SharePoint. Now SharePoint has a default timeout of 20 minutes on its web applications and its service applications.

And that is where the timeout of 19 minute (20 – 1 minutes) is sent back as KeepAliveIntervalSeconds to the client.

The best possible way to mitigate this issue is, increase the SessionTimeout with in Reporting services to 1200 seconds which is 20 minutes. Now this will make sure the report session will remain alive as long as the browser is kept open and the KeepAlive ping request will be triggered for every 19 minutes to ensure the report session within Reporting service is kept alive.

This is how you could increase the report session timeout for Reporting service 2012 in SharePoint integrated mode:

1. Browse the SharePoint central administration URL and navigate to Application Management -> Manage service applications (Under Service Applications).

2. Select the Reporting services service application and click on manage.

3. Click on System Settings.

4.  Locate the Session Timeout setting. The default value would be 600. Please change it to 1200.

5. Click on OK.

HTH!

Selva.

[All the posts are AS-IS with no warranty]