Consultor Eletrônico



Kbase P104890: How to display a Crystal Reports XI report using 'CrystalActiveXReportViewer' Control version 11 and
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/7/2005
Status: Unverified

GOAL:

How to display a Crystal Reports XI report using 'CrystalActiveXReportViewer' Control version 11 and 4GL?

FIX:

1. Create a new window using the OpenEdge AppBuilder.
2. Drop the Crystal Reports XI 'CrystalActiveXReportViewer' Control onto the window.
3. Add a button with the following CHOOSE event trigger:
DEFINE VARIABLE chApplication AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chReport AS COM-HANDLE NO-UNDO.

CREATE 'CrystalRuntime.Application.11' chApplication.
CREATE 'CrystalRuntime.Report' chReport.

/* Insert full path to the Crystal report */
chReport = chApplication:OpenReport("C:\OpenEdge\WRK\Customer11.rpt").

/* Enables the CRViewer's Navigation Controls */
chCtrlFrame:CrystalActiveXReportViewer:EnableNavigationControls = TRUE.

/* Enables the CRViewer's Export button */
chCtrlFrame:CrystalActiveXReportViewer:EnableExportButton = TRUE.

/* Disables the CRViewer's Search control */
chCtrlFrame:CrystalActiveXReportViewer:EnableSearchControl = FALSE.

/* Set the report source */
chCtrlFrame:CrystalActiveXReportViewer:ReportSource = chReport.

/* View the report */
chCtrlFrame:CrystalActiveXReportViewer:ViewReport().

RELEASE OBJECT chApplication.
RELEASE OBJECT chReport.