Crystal Reports in ASP.NET3.5

江枫思渺然 提交于 2020-01-01 19:43:31

问题


I am trying to add crystal report viewer in ASP.NET 3.5 application, but its giving me this error.

The type 'CrystalDecisions.Enterprise.EnterpriseSession' is defined in an assembly that is not referenced. You must add a reference to assembly 'CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'.

I have added this in web.config file under assemblies tag, added reference also. But still giving this error.

Any idea about it??

Thanks.


回答1:


Did you drag the Crystal Report Viewer control from the toolbox to your web page? If not, try doing it that way. Visual Studio is usually good to find all the appropriate references and add them when you do things that way.

Aside from that, you may need to add some additional libraries to your web.config. In my apps using Crystal, I have the following files referenced:

<assemblies>       
   <add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Desktop.Report, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Viewing.ReportSource, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</assemblies>

In addition, just before the closing system.web tag, I also have the following httpHandler added:

<httpHandlers>
   <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>

My app is using version 11r2 of Crystal Reports, so a few of the libraries may or may not exist, but most of them are the same.



来源:https://stackoverflow.com/questions/1575703/crystal-reports-in-asp-net3-5

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