In remote mode, the Report Viewer control requires session state be enabled or Report Server connection information specified in the config file.

In this article, we will fix the “Report Viewer control requires session state be enabled” issue that you may face when using Report Viewer control in your .Net / SharePoint solution.


Report Viewer control requires session state

When I tried to use a Report Viewer Control within a SharePoint Visual Web Part, I got the following error!

In remote mode, the Report Viewer control requires session state be enabled or Report Server connection information specified in the config file.

In remote mode, the Report Viewer control requires session state be enabled or Report Server connection information specified in the config file.

Cause

Session state has not been configured properly within SharePoint web.config.

Solution

  • Edit Web.Config of your SharePoint Web Application that located in
    •  C:\inetpub\wwwroot\wss\VirtualDirectories\PortNum
  • Search for enableSessionState > Set it to True.
<pages enableSessionState="true" enableViewState="true" 
enableViewStateMac="true" validateRequest="false" 
pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter,
 Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral,
 PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
  • Make sure that the following entry within <Modules> Tag
<modules runAllManagedModulesForAllRequests="true">
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" 
preCondition="" />
</modules>
  • Make sure that the following  entry within <httpModules> Tag
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
</httpModules>
  • After the <httpModules> Tag ,add this entry
<sessionState mode="InProc" cookieless="false" timeout="20"/>

Conclusion

In conclusion, we have learned how to configure Report Viewer control in web.config to enable session state.

See Also

Leave a Comment

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

Scroll to Top