For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > March 2006 > need some parameter HELP PLEASE!!









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author need some parameter HELP PLEASE!!
Leisa

2006-03-30, 7:06 pm

Hello. I'm writing a custom app in vb6 that calls a Crystal report (version
XI). The report has several parameters to it, but I'm not able to figure out
how to pass the variable from vb to cr. This is the code I've been trying and
it's not working....any help would be GREATLY APPRECIATED!! THANKS!!


'creating all the parameter field definitions
Dim crP1FDs As CRAXDDRT.ParameterFieldDefinitions
Dim crP1FD As CRAXDDRT.ParameterFieldDefinition

'creating parameter value fields
Dim pv1s As CRAXDDRT.ParameterValues
Dim pv1 As CRAXDDRT.ParameterValue

'setting all the parameter fields to parameters in the report
Set crP1FDs = Report.ParameterFields
Set crP1FD = crP1FDs.GetItemByName("firstairflow")
' crP1FD.AddCurrentValue (Val(first))
' Set pv1 = crP1FDs(1).Value

'THIS PART SAYS EXPECTED FUNCTION OR VARIABLE
Set pv1s = crP1FD.AddCurrentValue(Val(first))

'IF I COMMENT THE PREVIOUS LINE AND UNCOMMENT THE
CRP1FD.ADDCURRENTVALUE(VAL(FIRST)) LINE IT GIVES ME OBJECT VARIABLE OR WITH
BLOCK VARIABLE NOT SET FOR THE FOLLOWING LINE
Set pv1 = pv1s(1).StartValue

'IF I TRY THE FOLLOWING I GET TYPE MISMATCH ON THE SET PV1S LINE
Set crP1FDs = Report.ParameterFields
Set crP1FD = crP1FDs.GetItemByName("firstairflow")
crP1FD.AddCurrentValue(Val(first))
Set pv1s = Report.ParamterFields(1)
Set pv1 = pv1s(1).StartValue
pv1 = crP1FD.Value
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com