今天着实为这ReportViewer控件度了一天,狗了一夜,终于有成果,写个博客,给予需要有帮助的人。省得像我花一天时间去解决。
环境: Windows Server 2008 r2,SharePoint 2010,Visual Studio 2010, Sql Server 2008 r2
前台代码:就直接添加一个简单的ReportViewer控件
页面会报这个错:
没办法,这是2010,接着,我们需要修改Web.config几处地方,向SharePoint注册此控件
1. 在<handlers>结点加上加入下面三行代码
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="ReportViewerWebPart" verb="*" path="Reserved.ReportViewerWebPart.axd" type="Microsoft.ReportingServices.SharePoint.UI.WebParts.WebPartHttpHandler, Microsoft.ReportingServices.SharePoint.UI.WebParts, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<add name="ReportViewerWebControl" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
2. 在<configuration>结点,把<compilation debug="true"/>的debug设置为true
3. 在<modules runAllManagedModulesForAllRequests="true">结点里添加
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
</configuration>
4.在<appSettings>里 去掉
<add key="ReportViewerServerConnection" value="MyNamespace.MyRVServerConnectionClass, MyAssembly" />
<add key="ReportViewerTemporaryStorage" value="MyNamespace.MyTemporaryStorageClass, MyAssembly" />
<add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
然后刷新即可出现界面:
家里的环境是SharePoint2010,公司环境是2013,这有点坑了。明天继续...
以上可能因个人环境而异,请各位参考。。。
UNIX/Linux进程间通信IPC系列(六)信号量,布布扣,bubuko.com
原文:http://blog.csdn.net/yang_yulei/article/details/19775933