我正在使用Visual Studio 2010,并安装了“Microsoft Report Viewer 2012 Runtime”,希望能够在SQL 2012中测试新的报告系统。之后,我清除了引用“Microsoft.ReportViewer。 WebForms“,并从我的工具箱中删除了ReportViewer控件,并添加了新版本11 ReportViewer。ReportViewer 11(2012)Visual Studio 2010
我加入了新的控制到测试页和一个它增加了这个寄存器测试页:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
,并将其添加这些条目到Web.config:
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
<httpHandlers>
<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" />
</httpHandlers>
<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" />
</handlers>
工具箱中的控件是版本11的新增功能,但系统一直在尝试引用版本10版本。此外,当我尝试编译它时,我得到错误:
The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'
此修复程序的问题对我来说。我正在使用Azure虚拟机作为Web应用程序,数据库服务器是另一个单独的虚拟机,因此安装Report Viewer运行时无助,因为它也需要安装SQL Feature Pack。我刚刚从另一台服务器上复制了Microsoft.ReportViewer.Common文件夹,那里工作和繁荣 http://ata2931977.blogspot.com/2015/06/running-rdlc-reports-on-azure.html –