Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Problem with Select Expert and Multiple Parameters Post Reply Post New Topic
Author Message
synergy_texas
Newbie
Newbie


Joined: 28 May 2010
Online Status: Offline
Posts: 4
Quote synergy_texas Replybullet Topic: Problem with Select Expert and Multiple Parameters
    Posted: 28 May 2010 at 5:15am
I would like to have users select 1 of 3 parameters when the report runs.  I know how to create the parameters and use the Select Expert to lookup data on the report based on users input.  The problem is that the user should be able to choose from one of the three parameters.  However, two of them have a null value and when you select that from one of the parameter fields, the report gives you an error and says that this value is not valid.  I don't want them to force a value in there.  It should accept a null value and search by one of the other parameters listed.  Here is my Formula from the Select Expert.
 
{Command.stores_code} = {?Stores Code} or IsNull({?Stores Code}) or
{Command.stock_location} = {?Stock Location} or IsNull({?Stock Location}) or
{Command.Part_id} = {?Part Number}
 
So if Stores Code is null ..., then allow Stock Location or Part Number.  If Stock Location is null ..., then allow Stores Code or Part Number.  And if Part Number has a number in it, then allow Stores Code and Stock Location to be null.  This logic is not working.
 
Finally, if the users don't select any one of the three parameters, then it should list all records.  However, currently if they don't choose one of the three, then they get no records returned. 
 
I hadn't got that far yet, because I am working on the first half. 
 
Your help is greatly appreciated.
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 28 May 2010 at 6:37am
Okay, you have three parameters. On each parameter set the Optional Prompt option on the Parameter Edit screen under the Value Options field to 'TRUE'.
 
Then, in the Record Selection do:
 
if hasvalue({?Store Code})=YES
    then {?Store Code}={Command.stores_code}
        else
if hasvalue({?Stock Location})=YES
    then {?Stock Location}={Command.stock_location}
        else
if hasvalue({?Part Number})=YES
    then {?Part Number}={Command.Part_id}
        else
{Command.stores_code}={Command.stores_code}
 
This should get you what you want. The last part of it is just making sure that everything gets pulled in if nothing is selected for either three parameters.
 
However, I do believe that this will only work if they only select a value for ONE parameter. If they choose values for two of them, it won't work so you may need to rework it for that possibility.
 
HTH


Edited by FrnhtGLI - 28 May 2010 at 7:05am
|< /\ '][' ( )
IP IP Logged
synergy_texas
Newbie
Newbie


Joined: 28 May 2010
Online Status: Offline
Posts: 4
Quote synergy_texas Replybullet Posted: 28 May 2010 at 7:05am
Greatly appreciate your help.
 
I am using Crystal 11.  Don't have an Optional Prompt option in that version.  I do have Prompt with Description Only, Allow Multiple Values, Allow Discreet Values, and Allow Range Values.  They are False, False, True, False, respectively.  I don't believe you mean any of these.
 
I get the error: A number, currency amount, boolean, date, time, date-time, or string is expected here.
 
Looking this up, it appears to be a DLL issue.  I am updating reports that have been created by people in the past (same version though).  
 
Do you have any ideas? 


Edited by synergy_texas - 28 May 2010 at 7:05am
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 28 May 2010 at 7:09am
No, I do not. Guess it's new in 2008. And I'm assuming you are using Dynamic Parameters.
 
Only thing I can think of is to make them Static Parameters and set the Default Value to ALL and work the Record Selection that way.
 
Maybe we can get a true expert to chime in.
|< /\ '][' ( )
IP IP Logged
synergy_texas
Newbie
Newbie


Joined: 28 May 2010
Online Status: Offline
Posts: 4
Quote synergy_texas Replybullet Posted: 28 May 2010 at 7:57am
I am using Dynamic Parameters.  Static does not provide the dropdown lists that I need for the Stock Location.  Stores Code I can get away with because we only have a few.  But Stock Location drop down is a must requirement.  The problem is that Stock Locations can exist in multiple Stores.  So I need the functionality to select by Stock Location only, instead of Stock/Store. 
 
I keep messing with it and trying different things.  Will let you know if I find anything.  Once again, thanks for your help.


Edited by synergy_texas - 28 May 2010 at 7:59am
IP IP Logged
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.031 seconds.