Input paramter Crystal Report - Progress

Vittosss

New Member
Hi at all!!!
how i can passing parameter from progress (9.1C) to crystal report (9)?
I have made the code below...but...dont work!

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

DEF VAR ws-filter AS CHAR.
assign ws-filter = ("0011").

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

chApplication:LogOnServer("p2sodbc.dll", "9.1C v2", "", "sysprogress", "progress").

chReport = chApplication:OpenReport("C:\Documents and Settings\Administrator\Desktop\item3.rpt", 1).

chReport:ParameterFields:ITEM(1):ClearCurrentValueAndRange().
chReport:ParameterFields:ITEM(1):SetCurrentValue(ws-filter).

chReport:VerifyOnEveryPrint = TRUE.
chReport:DiscardSavedData.

chReport:PaperOrientation() = 1.

chReport:PrintOut().

RELEASE OBJECT chReport.
RELEASE OBJECT chApplication.


I have do on Crystal report a parameter field named "Item-Start".
i think the problem is here:
chReport:ParameterFields:ITEM(1):ClearCurrentValueAndRange().
chReport:ParameterFields:ITEM(1):SetCurrentValue(ws-filter).
but....i don't understand!!!

thanks at all!!!

Vittorio
 
Hello,
check the type of parameter u send, if it's an integer in crystal u've to pas an integer variable.
I think the best way is to pass always character param if u want to code a generic procedure.

tell me if u've some problem i've do that many times
 
Back
Top