Consultor Eletrônico



Kbase P3456: How to view a Crystal Report With Crystal Reports Viewer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Verified

GOAL:

How to view a Crystal Report With Crystal Reports Viewer

FACT(s) (Environment):

Progress 9.1C
Crystal Reports 8.5

FIX:


DEFINE VARIABLE crApplication AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE crReport AS COM-HANDLE NO-UNDO.

CREATE "CrystalRuntime.Application" crApplication.
CREATE "CrystalRuntime.Report" crReport.

/* Set the report object */
crReport = crApplication:OpenReport("c:\report1.rpt").
crReport:VerifyOnEveryPrint = TRUE.

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

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

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

/* Set the report source */
chCtrlFrame:CRViewer:ReportSource = crReport.

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

RELEASE OBJECT crApplication.
RELEASE OBJECT crReport.