We recently had a problem viewing an SQL Server 2005 Reporting Services report via the ReportViewer within a web page. The problem only occurred on one VM used for testing: there were no problems in the development or production environment.
The exception raised was:
Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired
After a bit of hunting around we found that modifying a timeout in the report server configuration resolved the problem. We increased the
DatabaseQueryTimeout within
<drive>:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\rsreportserver.config to more than the default value of 120s. Usual caveats about database timeouts apply.
<Configuration>
.
.
<Add Key="DatabaseQueryTimeout" Value="120"/>
.
.
</Configuration>
The key is described on MSDN at
http://msdn.microsoft.com/en-us/library/ms157273.aspx.
Specifies the number of seconds after which a connection to the report server database times out. This value is passed to the System.Data.SQLClient.SQLCommand.CommandTimeout property. Valid values range from 0 to 2147483647. The default is 120. A value of 0 specifies an unlimited wait time and therefore is not recommended.