Author |
Message |
Piinutti
Newbie
Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
|
Topic: Parameter with several choices does not work Posted: 12 Mar 2012 at 3:15am |
Hello.
I am trying to get to work a parameter in which you can choose the options you need for example what is the state of the purchase order..
I have made the parameter but it does not separate any data.. So it does not work.
What I am doing wrong?
Below you can see a picture about the parameter. You should be able to select all of the values or maybe just one of them.
|
IP Logged |
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|
Posted: 12 Mar 2012 at 3:50am |
Did you already created a formula in your record selection, linking your paramater to a field in your dataabase?
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 12 Mar 2012 at 8:56am |
CR selects them as an array of values...to check if what you want is in the selected values you would use something like: {table.field} in {?parameter} check help for arrays for more syntax.
|
IP Logged |
|
Piinutti
Newbie
Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
|
Posted: 12 Mar 2012 at 8:51pm |
Thanks for fast reply..
Of course I forgot to create the formula...
I am newbie with the Crystal Reports..
|
IP Logged |
|
Piinutti
Newbie
Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
|
Posted: 12 Mar 2012 at 10:58pm |
I have now created the formula for the parameter but it still does not give me the right results. It doesn't limit the data in any way..
I tried the lockwelle's way but that didnt work. I also tried the Join ({parametername},",") formula.. That either does not give me any results..
I am quite sure that the fields in parameter are the right ones.. Is there anything else I can do?
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 13 Mar 2012 at 4:02am |
there are formula fields that you create in the field explorer which can be used to manipulate data and display it in the report canvas.
There is also a Select Expert (the button with a hand selecting a red circle from 2 blue circles) which is where you create a boolean formula to determine if a row should be included (true) or excluded(false) in the report.
The suggestions for the formula were intended to be used in the select expert.
Edited by DBlank - 13 Mar 2012 at 4:03am
|
IP Logged |
|
kostya1122
Senior Member
Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
|
Posted: 13 Mar 2012 at 6:39am |
i would suggest trying
{table.field} like "*"+{?parameter}+"*"
or {table.field} = trim({?parameter})
|
IP Logged |
|
Piinutti
Newbie
Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
|
Posted: 13 Mar 2012 at 8:18pm |
Does it make difference that the field from which I am trying to get the data, is a pull-down menu? I am going to try the kostya's way now to see does it make a difference in results..
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 14 Mar 2012 at 5:02am |
from your screen image i assume you are aware that the actual value that is being used for comparison is 1,2,3,4 or 8 as a string.
so if you use
table.field = {?parameter}
it is expecting that table.field is a string data type with only 1,2,3,4 or 8 in it.
also are you inserting this in the select expert or into a formula field?
If you have been inserting it into the select expert I would have expected that it would have returned 0 records (if it is is written incorrectly) rather than having no impact on your record selection as you are describing.
Edited by DBlank - 14 Mar 2012 at 7:14am
|
IP Logged |
|
Piinutti
Newbie
Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
|
Posted: 14 Mar 2012 at 8:09pm |
The meaning of this parameter is that it allows us to select purchase orders by its state (confirmed, open, invoiced etc)from a pull-down menu. So with the parameter we should be able to select one or more of these values. And the results should be the purchase orders which are for example invoiced, not the other ones (for example confirmed or delivered, only the invoiced). Now I am getting all of the purchase orders as a result. This parameter does not limit the results any way. And it is frustrating.
I have inserted in formula field and then I have inserted the formula into the report. I haven't tried to insert into select expert.
I hope this clarified what I am trying to do here.. I am such a newbie with the CR...
|
IP Logged |
|
|