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

Parameter Multiple choice selection

Status
Not open for further replies.

gsmithmme

Technical User
Jun 3, 2004
51
US
I am using Crystal 8.5 with a paradox database. I would like to use a record selection parameter that asks the user which of the following location information would you like in your report

1. Seattle
2. Hollywood
3. New York
4. Atlanta

The user could then select any of the 4 choices (or all 4), and the record selection formula would include their choices.

I know I can do it by using a number parameter and making all the options available, but that would be clunky and a pretty lengthy list. Ideally, I would like the user to select a checkbox of either 1 or 2 or 1 & 2 or 1 & 4 or whatever.

Does anyone have a suggestion on how to accomplish this?
 
Hi,
IIRC, a multiple value parameter actually creates an Array for the choices so you could probably create a selection criteria something like:
Code:
StringVar Pvalues := Join({?Parameter},",");
{table_location} IN "(" + Pvalues + ")"

Depending on your database's willingness to accept unquoted strings, you may need to use:
Code:
numberVar MaxVals := UBound({?Parameter});
numberVar cntr;
StringVar ValueList := "";
for cntr := 1 to MaxVals do
  If cntr <> MaxVals then
  ValueList := "'" + {?Parameter}[cntr] + "',"
  else
  ValueList := "'" + {Paremeter}[cntr] + "'"
;
{table_location} IN "(" + ValueList + ")"




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Since this is a multiple value parameter, all you need to do is add "All" as a value on your list of cities (I would use the city names) and then use a selection formula like:

(
(
{?City} <> "All" and
{table.city} = {?City}
) or
{?City} = "All"
)

...and let the user select individual or all values on the list. I can see the value of having "All" if the list is lengthy, but creating combinations of the other values, in addition to allowing individual values, would only give the user even more options to look at and be confused by.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top