Consultor Eletrônico



Kbase P37950: How to print a Crystal Reports report via the 4GL
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Verified

GOAL:

How to print a Crystal Reports report via the 4GL

FIX:

To print a report from Crystal Reports in the 4GL, use the following code:

DEFINE VARIABLE chApplication AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chReport AS COM-HANDLE NO-UNDO.

CREATE "CrystalRuntime.Application" chApplication.

chApplication:LogOnServer("pdsodbc.dll", "odbc dsn", "", "user name", "password, cannot be blank").

chReport = chApplication:OpenReport("report file name").

/* The FALSE parameter below will keep the print dialog from displaying. */
/* See Crystal Reports ActiveX documentation for other options. */

chReport:PrintOut(FALSE).

RELEASE OBJECT chReport.
RELEASE OBJECT chApplication.