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

Problem with "IN" operator of crystal 1

Status
Not open for further replies.

Videla

Programmer
Jul 28, 2005
98
US
Hi,

I am developing a report using CR XI designer and facing a problem with using "IN" operator of crystal. Let me explain with a simple example.

assume the table data is

employee salary
------------------------
emp1 100
emp2 200
emp3 150

Now my simple report has two columns employee and salry and i am trying to apply selection criteria on "employee" field.
i selected "one of" from dropdown and selected two values emp1, emp2. formual is as below.

emp.employee in ["emp1","emp2"]

it is working perfectly fine.

i created a parameter "param1". and changed the selection criteria so that formula will be as below.
emp.employee in [{?param1}]

This time when i refresh in designer it prompted for value and i entered "emp1","emp2". Report is not displayingany output. I also tried put param1 on header, but to my surprise it shows as "emp1","emp2". I am wondering why result is not getting displayed. Am i missing something!!!
appreciate your help in fixing this.

Thanks
Ravi
 
I think it's looking for a string that contains "emp1","emp2". A perfectly possibly string value, but you are looking for emp1 etc. I'd have been surprised if you'd got away with it (though it might depend on your Crystal value).

What you could do is have two parameters, or however many you need, but each to have an individual value like emp1.

You also might be able to do something fancy with tables or splitting. But I'd figure that several parameters is easier.

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

I can not have multiple parameters, as i wont be knowing how many values to pass. To simplify the problme, i gave this example.
But in real applicaiton user will select values from a listbox in asp.net and we have to pass those values to crystal, so that it will frame IN clause and execute the query.


Thanks
Ravi
 
Your selection formula should be:

{emp.employee} in {?param1} //no brackets

-LB
 
Hi lbass..Thats terrific..Its working perfectly..Thanks for your help.

Thanks
Ravi
 
Hi,
In many cases, using an = works as well with multi-value parameters..

{emp.employee} = {?param1}
//{?param1} defined as allowing multiple, discrete values


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top