根据您所遇到的问题,您有几个选项。如果这些建议对您无效,请更详细地描述您在控件方面遇到的问题。例如,您是否在设计器中遇到了问题、Microsoft 更改了其功能或API,或者是在运行时出现异常?
- 如果问题与报表查看器的API或运行时行为有关,并且您已经安装了VS 2008和VS 2010,则可以非常容易地移除项目引用下的Microsoft.ReportViewer.WebForms的2010版本(实际上是版本10.0)。然后您可以使用添加引用对话框来选择来自2008年的版本(实际上是版本9.0)。您还需要更新每个使用报表查看器的页面,并将版本10的声明替换为以下版本9的声明。
在每个页面中,将以下内容替换:
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
使用:
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
在web.config中替换以下内容:
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
使用:
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
在web.config文件中,将以下内容替换为:
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
使用:
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
在web.config中替换以下内容:
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
随着:
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
除了这些步骤,你还应该登录Microsoft Connect并详细报告你遇到的问题,以便他们可以修复并在Visual Studio 2010的RTM(或补丁)中包含它。