on 06-22-2010 7:54 AM
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} ="USA" or {?@cmpy} ="usa" then
"This is test 1 sentences"
else if {?@cmpy}="TWD" or {?@cmpy} = "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.
Edited by: DeanLai on Jun 22, 2010 8:54 AM
Moved to Legacy SDK forum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) Do not use craxDDrt.dll, use craxDrt.dll. There are licensing implications to craxDDrt.dll and unless you are aware of these using craxdrt.dll will be better.
2) Make sure you have the latest updates for your version of CR - which you do not mention...
Updates and other downloads can be found [here|http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm]
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
I really thanks your time.
I had tried to remove all subReport except the mainreport,
But It also show "This field name is not known".
Now, I have two methods that can run well.
one is remove these two forumla,
two is change the vb code
from
oRpt.ParameterFields(3).AddCurrentValue ("UMC")
to
oRpt.FormulaFields.GetItemByName("a").Text= "This is test 1 sentences"
That is to say, If I want the process success, I have to drop the forumla which is
relation with Parameter.How strange!!
Do I miss something??
I Find something.
First I tried to add parameter and wanted to see these value on Report.
So I inserted {?@cmpy} and {?@p1} into report, and used VB code
"oRpt.ParameterFields(1).AddCurrentValue ("TWD")" and "oRpt.ParameterFields(2).AddCurrentValue ("1")",
then ran the process, but it didn't display any value on report,
so why it couldn't pass value into parameter??
then I tried other way which was to add new parameter, and used the same way to pass
value into parameter, then it can display value on report.
So the different between these is {?@cmpy} and {?@p1} which come from
Stores Procedure.
While I set Database in crystal report, set all value into Store Procedure's
parameter(the window about "Enter Parameter Values"), then it automatic come out the DB columns and parameter(SP parameter)
, course include {?@cmpy} and {?@p1}.
Do this problem cause my question?
Can we pass value into parameter which come from SP parameter??
Can we use these parameter into forumla??
Edited by: DeanLai on Jun 30, 2010 11:56 AM
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.