We intentionally filter the Crystal Reports controls from the toolbox and also prevent users from adding these controls from Add Controls dialog directly.
The issue comes from the hard-coded dependency that the CrystalReportViewer .NET Control has with the Microsoft Visual Studio environment. Progress cannot fix the issue unless this dependency on the Microsoft Visual Studio environment is removed from the Crystal Reports assemblies.
However it is still possible to utilize Crystal .NET controls in your OpenEdge Project by using the Assembly References Tool to add the Crystal references.
The attached basic example shows the steps:
1) In PDSOE or Procedure Editor, add Assembly References to the Project.
- Right-click on the Project and select Properties.
- Expand OpenEdge and select Assemblies.
- Click Add to display the "Add Assembly References" dialog.
- In the Global Assemblies tab, Filter on "CrystalDecisions" to display Crystal assemblies.
- Select the required assemblies and click OK.
The assemblies will appear in Referenced Assemblies in the Project.
Similar steps are described for the Procedure Editor in the following article:
How to add custom .NET DLL's in the Procedure Editor?
Article 000060216, How to add custom .NET DLL's in the Procedure Editor?
2) Use this User Control (ReportViewer.cls) to wrap the Crystal Report Viewer.
At this point this User Control can't be added graphically to any form, since Crystal Reports Definitions in InitializeComponent method invalidate any graphic support for this file. All modifications need to be done directly in the code.
The attached sample code is created to work with a sample sports2000 database. If testing with other database then any parameter in this example code needs to be updated according to the other database.
3) The User Control can now be added to an ABL Form. In this example form1.cls is provided to run an ABL form and include the Crystal Report Viewer.
Note: It is possible to call the CrystalReportViewer programmatically but this approach will require more manual coding. Article shows an example:
How to create a Crystal Report with .Net CrystalDecisions assembles and export the report to a .pdf file
Article 000056268, How to create a Crystal Report with .Net CrystalDecisions assembles and export the report to a .pdf file
4) Instantiate an object of form1.cls and run the form. (see run_cr.p)
To run the attached sample:
- Export all files in sample_cr.zip file
- Create a sports2000 database
- Update parameters if needed in ReportViewer.cls
- Compile code with compile_sample.p
- Open a proenv window and run run_cr.p:
Proenv> prowin32 –p run_cr.p
** This is a sample report and code to test functionality, it’s not intended to be used in production as it is.