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

Reference for CrystalReports.Engine.ReportDocument object class

mbenigni
Explorer
0 Likes
6,251

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,

See my Blog for upgrading, it answers a lot of your questions:

https://blogs.sap.com/2020/10/30/upgrading-a-visual-studio-2008-2019-.net-project-with-the-latest-cr...

As Dell noted, don't mix CR runtime. Version 13 is standalone and version 14 if connecting to BOE/CR Server. No longer can connect to those using CR 13 runtime, not needed if you don't.

Main thing to note is you must set all Copy Local to False, clean out your \bin folder of any CR dll's that may have been left over, mixing runtime will cause problems.

Also note with VS 2022 your app.config file should no longer be adding CR references and CR runtime is for you platform and not the OS.

Also, when adding the CR Viewer to your Windows Form be sure you are selecting the right version, I also recommend not browsing to the assemblies but using the Extensions tree in VS to select them

Don

mbenigni
Explorer
0 Likes

Thanks so much for all of this information, Don! There's a lot to process here, but I'll do some homework and report back.

Best,
Marc

mbenigni
Explorer
0 Likes

Hello again,

I've followed through your blog article, and a number of other articles linked from there. I did make some progress: it looks like I hadn't properly installed SAP Crystal Reports for Visual Studio after all. After remedying that problem, I now have the following in Programs and Features:

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

All older versions (Crystal Reports 9, Crystal Reports 2008) have been uninstalled.

However, I'm still not seeing an available COM reference with which to replace/upgrade CrystalDecisions.CrystalReports.Engine, so I'm effectively stuck.

Note I'm trying to build to .NET 6.0 in VS2022 in order to best future-proof this work. Is this platform not supported?

Best,
Marc