schlosser0169
New Member
I am using Crystal Reports 8.5. I am trying to pass a parameter from my progress app to Crystal Reports. My parameter is not
being passing to the SQL query.
How do I "link up" my parameter to the SQL query.
I have used some code I found on this site but I am missing
something.
DEF VAR sReportName AS CHARACTER.
DEF VAR sName AS CHARACTER.
DEFINE VARIABLE sUserId AS CHARACTER NO-UNDO.
DEFINE VARIABLE sPassword AS CHARACTER NO-UNDO.
def var hCRApp as com-handle no-undo.
def var hCRRpt as com-handle no-undo.
sReportName = "c:\export\report1.rpt".
sName = "sports".
sUserId = "user".
sPassword = "password".
/* create handle to CRAXDRT */
CREATE "CrystalRuntime.Application" hCRApp NO-ERROR.
/* open the report via RDC Com object */
hCRRpt = hCRApp:OpenReport(sReportName, 1).
/* Send LogOnInfo to connect to database */
hCRRptatabase:Tables(1):SetLogOnInfo(sName, "", sUserId, sPassword).
/* Replace Crystal Parameter */
hCRRptarameterFields(1):SetCurrentValue(custNum).
CustNum is my input variable.
Thanks
Sandra Schlosser
being passing to the SQL query.
How do I "link up" my parameter to the SQL query.
I have used some code I found on this site but I am missing
something.
DEF VAR sReportName AS CHARACTER.
DEF VAR sName AS CHARACTER.
DEFINE VARIABLE sUserId AS CHARACTER NO-UNDO.
DEFINE VARIABLE sPassword AS CHARACTER NO-UNDO.
def var hCRApp as com-handle no-undo.
def var hCRRpt as com-handle no-undo.
sReportName = "c:\export\report1.rpt".
sName = "sports".
sUserId = "user".
sPassword = "password".
/* create handle to CRAXDRT */
CREATE "CrystalRuntime.Application" hCRApp NO-ERROR.
/* open the report via RDC Com object */
hCRRpt = hCRApp:OpenReport(sReportName, 1).
/* Send LogOnInfo to connect to database */
hCRRptatabase:Tables(1):SetLogOnInfo(sName, "", sUserId, sPassword).
/* Replace Crystal Parameter */
hCRRptarameterFields(1):SetCurrentValue(custNum).
CustNum is my input variable.
Thanks
Sandra Schlosser