Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why I can't pass parameters into CR from VB6

Status
Not open for further replies.

DeanLai

MIS
Jun 14, 2010
5
TW



I want to Pass parameters into crystal report from VB6.
But whatever I try, it don't work Fine,
always Show the message "This field name is not known".

Crystal Report::
Parameter: a.@cmpy;
b.@p1
formula:
a. If {?@cmpy} in ["USA","usa"] then
"This is test 1 sentences"
else if {?@cmpy} in ["TWD","twd"] then
"This is test 2 sentences"

b. if trim({?@p1})="1" then "This is test 3 sentences"

VB::
Public oApp As New CRAXDDRT.Application
Public oRpt As CRAXDDRT.Report
...
oRpt.ParameterFields(1).ClearCurrentValueAndRange
oRpt.ParameterFields(2).ClearCurrentValueAndRange
oRpt.ParameterFields(1).AddCurrentValue ("TWD")
oRpt.ParameterFields(2).AddCurrentValue ("1")
...

I had trid to use "IsCurrentValueSet" function to check whether parameter was set or not, and It responsed "Ture",so I so confused about it.

Anyone know about this??

ps. I had trid other way that change the formula indirectly, although it can work fine, but it isn't a right way to solve my problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top