mfg_newbie
Member
Please help me to fix this error.
this is my code
this is my code
Thank in advancePROCEDURE viewreport :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE chApplication AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chReport AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chConnProps AS COM-HANDLE NO-UNDO.
CREATE 'CrystalRuntime.Application' chApplication.
run p_debug ("Create Report").
CREATE 'CrystalRuntime.Report' chReport.
/* Insert full path to the Crystal report */
chReport = chApplication:OpenReport("e:\test\Test.rpt").
/* Set the Connection Info to Connection Properties of the table object */
chConnProps = chReportatabase:Tables(1):ConnectionProperties.
/* Clear the ConnectionProperties collection */
chConnPropseleteAll.
/* Add the ODBC DSN */
chConnProps:ADD("DSN", "fov").
/* Add the database level User ID if required */
chConnProps:ADD("sysprogress", "sysprogress").
/* Add the database level password if required */
chConnProps:ADD("fov", "fov").
/* Example of some adjustable parameters */
MESSAGE "VALID-HANDLE (chCtrlFrame) IS: " + UPPER(string(VALID-HANDLE (chCtrlFrame))) VIEW-AS ALERT-BOX.
chCtrlFrame:CrystalActiveXReportViewer:EnableNavigationControls = TRUE. /* Enables the CRViewer's Navigation Controls */
chCtrlFrame:CrystalActiveXReportViewer:EnableExportButton = TRUE. /* Enables the CRViewer's Export button */
chCtrlFrame:CrystalActiveXReportViewer:EnableSearchControl = FALSE. /* Disables the CRViewer's Search control */
/* Set the report source */
chCtrlFrame:CrystalActiveXReportViewer:ReportSource = chReport.
/* View the report */
chCtrlFrame:CrystalActiveXReportViewer:ViewReport().
run p_debug ("Release Objects").
RELEASE OBJECT chConnProps.
RELEASE OBJECT chReport.
RELEASE OBJECT chApplication.
ASSIGN chConnProps = ?
chReport = ?
chApplication = ?.
END PROCEDURE.