-------------------编写人:Lidan-------------------
前面有写过SharePoint2010中使用ReportViewer的,现把SharePoint2013中使用的配置也写一下,能供大家参考
(1) 在<handlers></handlers>结点中添加如下内容(须添加在结点下第一行)
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
(2) 在<httpHandlers></httpHandlers>结点中添加如下内容(须添加在结点下第一行)
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
(3) 在<modules runAllManagedModulesForAllRequests=”true”>结点下,注释
<remove name=”Session” />
(5) 在<pages enableSessionState=”false” enableViewState=”true” …/>修改为
<pages enableSessionState=”true” enableViewState=”true” …/>
(6) 在<appSettings></appSettings>结点中注释
<add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
-------------------------------另:如果遇到此错误-------------------------------
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom sessionstate store in 'Custom' mode.
解决方案:
将<sessionState mode="SQLServer" timeout="60" allowCustomSqlDatabase="true" sqlConnectionString=.../>
修改为<sessionState mode="InProc" timeout="60" allowCustomSqlDatabase="true" sqlConnectionString=.../>