Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Parameter with several choices does not work Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Piinutti
Newbie
Newbie


Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
Quote Piinutti Replybullet 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 IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet 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 IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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 IP Logged
Piinutti
Newbie
Newbie


Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
Quote Piinutti Replybullet 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 IP Logged
Piinutti
Newbie
Newbie


Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
Quote Piinutti Replybullet 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 IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 13 Mar 2012 at 6:39am
i would suggest trying

{table.field} like "*"+{?parameter}+"*"

or
{table.field} = trim({?parameter})
IP IP Logged
Piinutti
Newbie
Newbie


Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
Quote Piinutti Replybullet 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 IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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 IP Logged
Piinutti
Newbie
Newbie


Joined: 12 Mar 2012
Location: Finland
Online Status: Offline
Posts: 17
Quote Piinutti Replybullet 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 IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.