ASP.Net和Cryatal报告 [英] ASP.Net and Cryatal Report

查看:74
本文介绍了ASP.Net和Cryatal报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我的机器Visual studio 2005和visual studio 2010上安装。我在asp.net工作,并使用Visual Studio 2010下载了SAP Crystal Report。现在我收到了以下错误。我如何解决它。



任何建议都非常感谢。



编译器错误消息:CS0433:类型'CrystalDecisions.Web.CrystalReportViewer'存在于'c:\ WINDOWS \assembly \ GAC_MSIL \CrystalDecisions.Web \13.0.2000.0__692fbea5521e1304 \CrystalDecisions.Web.dll'和'c:\ WINDOWS中\assembly\GAC_MSIL \CrystalDecisions.Web \10.2.3600.0__692fbea5521e1304 \CrystalDecisions.Web.dll'





谢谢

Shafik

Hi All,

In my machine visual studio 2005 and visual studio 2010 installed. I am working in asp.net and downloaded SAP Crystal Report with Visual Studio 2010. Now I am getting below error. How Can I Resolve it.

Any suggestion is highly appreciated.

Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Web.dll'


Thanks
Shafik

推荐答案

我发现这只是一个简单的搜索:



http://forums.asp.net/t/1781536.aspx/1 [ ^ ]
I found this with a simple search:

http://forums.asp.net/t/1781536.aspx/1[^]


有2个阶段来解决这个问题:



第1阶段:确保您的.net框架目标是相关的克拉。 (如果使用vs2008则应为3.5,如果使用vs2010则应为4.0和2.0 for vs2005)



阶段2:检查您正在使用的晶体报告的版本您的项目/网站并根据您的web.config进行更改







详细解决方案:



阶段1:



1.在解决方案资源管理器上,右键单击您的项目,转到属性 - > ;构建

2.将目标框架设置为4.0 for vs2010 / 3.5 for 2008 / 2.0 for 2005



阶段2:



1.检查您正在使用的水晶报告的版本

2.如果您在aspx页面上删除了水晶报告控件,在源代码中您可以请参阅顶部的以下行:

There are 2 phases to solve this problem:

Phase 1: Make sure that your .net framework target is correct. (if using vs2008 it should be 3.5, if using vs2010 it should be 4.0 and 2.0 for vs2005)

Phase 2: Check the version of crystal reports you are using in your project/website and make changes accordingly to your web.config



Detailed Solution:

Phase 1:

1. on solution explorer, right click on your project, go to properties -> build
2. set target framework to 4.0 for vs2010 / 3.5 for 2008 / 2.0 for 2005

Phase 2:

1. check the version of crystal reports you are using
2. if you have dropped the crystal reports control on your aspx page, in the source you can see following line on the top:
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>







注意水晶报告的版本10.5.3700.0



3.打开你的web.config文件



你会看到这段代码:




Note the version of crystal reports 10.5.3700.0

3. open your web.config file

you will see this code:

<assemblies>
             <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
      </assemblies></assemblies>





4.只需保留此代码中的13.0版本条目,并删除所有其他条目,如下所示:



4. just keep the 13.0 version entries in this code, and delete all other entries as follows:

<assemblies>
  
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      </assemblies>





















5.执行此操作后,尝试重建或运行项目,它将起作用。











5. after doing this, try to rebuild or run the project and it will work.


Go in your web.config file and search for these lines:

<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

I am sure there are more than one reference for different version, so find the correct version and remove others.

 Hope this will help you


这篇关于ASP.Net和Cryatal报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆