cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reference for CrystalReports.Engine.ReportDocument object class

mbenigni
Explorer
0 Likes
6,258

Hello, all.

I'm trying to build a simple VS2022 test application integrating the trial version of CR2020. There is effectively one line of code:

Dim CrystalReportSource1 As New CrystalDecisions.CrystalReports.Engine.ReportDocument

Which is returning an error:

BC30002 Type 'CrystalDecisions.CrystalReports.Engine.ReportDocument' is not defined.

I need to know what reference to add or Import in order to be able to use this ReportDocument object class (or an alternate object class name, if this has changed to something outside the CrystalDecisions namespace.) I've tried a number of Crystal Reports 14.0 references that looked promising but didn't help. And in previous (CR2008) versions of this same project I had successfully used the following Imports statements, but the targets are no longer found:

Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.CrystalReports.Engine.ReportDocument

Thanks in advance!

View Entire Topic
mbenigni
Explorer
0 Likes

Perhaps this has been the issue all along. I targeted "AnyCPU", but I'm just now noticing the "Prefer 32-bit" checkbox on the Compile tab. If this is indeed the cause of the original error, than I should be able to rename by 32-bit DSN back to a distinct name (different from the 64-bit DSN) duplicate the error, then uncheck this checkbox to force full 64-bit operation, and see a successful run. (Much as I'm tempted to just leave well enough alone.) I'll try this later today and let you know what I find.

Best,
Marc

mbenigni
Explorer
0 Likes

And that appears to have done it! I renamed our 32-bit DSN to [DSNName]32, differentiating from the 64-bit [DSNName], duplicated the database logon error, then unchecked the Prefer 32-bit checkbox. Now the application is running successfully.

In summary, it looks like the critical changes were:
- Building a WPF Application (.NET framework) rather than a WPF App (Core)
- Adding the correct v13.0 references via the Assemblies tab
- Ensuring the app was targeting a 64-bit build to correspond with the report file's 62-bit DSN reference

Thanks again to both you and Dell for all your help!

Best,
Marc