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

Reference for CrystalReports.Engine.ReportDocument object class

mbenigni
Explorer
0 Likes
6,240

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
DonWilliams
Active Contributor
0 Likes

Hi Marc,

You don't need to manually install the MSI packages on your DEV PC.

When you install CR for Visual Studio SP33 64b installer (VS 2022 and above) it will install the 64 bit MSI but not show it in Programs and Features. At the end of the install it will prompt if you want the 32 bit runtime, Click OK and install it.

You should only see this for CR for VS, CR Designer doesn't matter for this install:

SAP Crystal Reports Runtime Engine for .NET Framework (32-bit)
SAP Crystal Reports, version for Microsoft Visual Studio (64-bit)

We don't support any higher framework than 4.8 is likely the cause, select 4.7 or 4.8 only.

Almost there...

Uninstall the 64 bit MSI and then repair the installer, because it's going to remove all of the runtime.

Thanks again

Don

mbenigni
Explorer
0 Likes

Thanks, Don. Before I uninstall/reinstall anything, did you happen to see my reply to Dell's most recent comment above? I was finally able to build a WPF App (not WPF Application) project using .NET 4.7.2, and this exposes all of the correct COM references via the Assemblies tab in the Reference Manager. The only outstanding issue is that my report object's ExportToDisk method is throwing a "Failed to open connection" exception. Do you think that uninstalling the 64-bit CR for VS and reinstalling is likely to correct this?

Thanks again,
Marc