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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter use in select formula

Status
Not open for further replies.

Hueby

MIS
Oct 20, 2004
321
US
Hello all,

I have a multiple value parameter coming in from a VB.NET app. I want to use it in my select formula for a CR 10 report.

For example the parameter (@cat) will be a string and contain something like: "A", "B", "C"

Then in the select expert formula in the report I have this:
Code:
{IM_ITEM_MASTER_MC.Item_Category} like {?@cat}

I have teh @cat parameter as a string and allow multiple values. Though when I run the report it does work, it pulls up blank. I am wondering if my select formula is wrong?

It is coming from VB.NET okay, when I just display the string value in a label on the report I can see the "A", "B" and so on.
 
I'm not sure you are using the correct operator. Like is for pattern matching eg {customer.LAST NAME} like "*s?n*".

I think you should be using the IN array eg {file.COLOR} in ["Red", "White", "Blue"].

 
Also I do not think a "?@cat" would evaluate to "?A" you would need something like "?" + @cat

Just a thought
djj
 
Thanks guys, I switched it over to a IN operator. But no luck...

Also, I thought the ? just noted it was a parameter. Technically "?@cat" needs to be replaced with the "A", "B".. i'm not sure I'm understanding the "?" + @cat though?
 
Maybe you should use 'Split' to isolate the elements of the parameter and use each separately. (Use Crystal HELP or SEARCH here if you don't know Split)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hueby,

I think you need to reverse the order of the elements of the IN function above.

Code:
 {?@cat} [blue]IN[/blue] {IM_ITEM_MASTER_MC.Item_Category}

I have never used this in the context of multiple values in the parameter (array), but it does work for one value.

Hope This Helps,


Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
Thought you where using the "?" as a wild card. Thus my suggestion was to concatenate to your value.
Ignor me is sometimes the best thing to do.[smile]
djj
 
MCuthill, I tried to reverse the order, but get an error of "This array must be subscripted. For example array: ".

Not sure how to proceed with this... ???


Madawc, Thanks for the idea. I'll look into using the SPLIT, never thought of using that.
 
Please show us exactly how the parameter created in VB.net displays when placed on the report--specifically, how the quotes appear. Also, you say it is set up for multiple values. Does this mean that there might be multiple strings or do you just mean that there will be one string with multiple values?

-LB
 
lbass, the parameter will display as actually: "A", "B", "C" - with the quotes. I can remove the quotes if needed, but that is how I have it setup at the moment.

I have the parameter in CR set to allow multiple values (under the options)... but really it is just one string with multiple values.

Does this help? thanks!
 
Then it seems like:

{IM_ITEM_MASTER_MC.Item_Category} in {?cat}

...should work. If the list of values is coming into CR as a single string (not multiple strings), then set the parameter in CR to NOT allow multiple values.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top