views:

882

answers:

1

Hi All,

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  A: 

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.

Dillie-O
Thanks for your help but it was still giving same error, then I tried adding a crystal report in solution. And it added the assembly by itself, and now it works fine.Its weird behavior of VS, because I dont want to create any report in my solution, I have some .rpt files on a shared drive and I just want to populate them in this application, so I was creating just a report viewer. Anyways thanks for your help.
Zinx