Error in using report viewer in visual studio 2012 in design mode

我的未来我决定 提交于 2019-12-10 18:45:22

问题


I'm using visual studio 2012 to develop a MVC application. I have added an ascx page to my project to put the report viewer in. When I drag and drop the ReportViewer component from toolbox in the page, It doesn't show the ReportViewer correctly and shows this error on it:

Failed to create designer 'Microsoft.Reporting.WebForms.ReportViewer, Microsoft.Reporting.WebForms version 10.0.0.0, Culture=natural, PublicKeyToken=b03f5f7f11d50a3a'

I have also added Microsoft.ReportViewer.WebForms assembly to the project References. Is there anything wrong with reportviewer in Visual Studio 2012? Any help is appreciated in advance.


回答1:


SOLVED!

  1. I downloaded and installed Report Viewer 2010 version.
  2. Then I added Microsoft.ReportViewer.WebForms.DLL assembly file from C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91.
  3. And finally I added the following line to the .ascx file. <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>



回答2:


See in solution explore and explore the Reference link and remove ReportViewer Forms and WindowReportViewer then simple add the report viewer from toolbox, its works for me




回答3:


I hope this helps someone as I found a very simple solution to this problem...

Go HERE and download the v11 of Reportviewer.

Then from the toolbox right click on general... Click Choose Items and the browse to from the .NET Framework components C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91

That will add the ReportViewer to your toolbox!



来源:https://stackoverflow.com/questions/16055601/error-in-using-report-viewer-in-visual-studio-2012-in-design-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!