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

One Parametewr value with multiple value 2

Status
Not open for further replies.

HulaGirl

Programmer
Apr 6, 2002
20
US
I am using CR v7. I have a parameter set up so users can choose any default zip codes in a state for example California. Users can choose discret zip codes or range of zip caodes. I would like to add a default value like "Los Angles" so that when user choose it, all zip codes in Los Angles will be selected. This way, users can choose discret zip codes, range of zip codes, and zip codes by city. Thank you for helping...
 
this can be hard coded. Setup "Los Angeles" as a default value. Then in your record selection formula, try the following:

If {?Parameter} = "Los Angeles" then {Zipcode} in 92001 to 92999
//or whatever los angeles' zip code range is

else {zipcode} in {?parameter} Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
hmmm...what you want to do requires a lookup table built into a formula...cannot use arrays in a Record Select... where you have the city, lowerzipcode, upperzipcode

this is going to be evaluated clientside though...you realize that... since you cannot pass the values to the server...although it might not be too bad.

I would adopt the approach that SV has suggested (sorry, synapsevampire, the advice is good but your name is too long...lol)

One for City and one for Zipcode.

the default for {?City} would be "ALL" and you might make a picklist of allowable cities.

the default ZipCode would be an upper and lower range to cover all possible zipcodes

then you would make a "selection formula"...you would test {?City} first...if it isn't "ALL" then the city's zipcodes will over-ride those chosen in the {?Zipcode} parameter ... something like this:

there is no "whilePrintingrecords" here and the result of this formula is boolean.

@SelectZipCodes

if {?City} <> &quot;ALL&quot; then
{table.zipcode} in {?ZipCode}
else
(
Select {?City}
Case &quot;Los Angeles&quot; :
{table.zipcode} in (enter a zipcode range here)

Case &quot;New York&quot; :
{table.zipcode} in (enter a zipcode range here)

Case &quot;Miami&quot; :
{table.zipcode} in (enter a zipcode range here)

..... add as many cases as you want ....

//must have a catchall to grab all zipcodes
//if a non-choice made **Note the semi colon at the end
//of the default choice
Default :
{table.zipcode} in (enter max/min zipcode range);
);


this might work ok JimBroadbent@Hotmail.com
 
ooops! That formula is placed in the record selection formula


(...other filters...) and
@SelectZipCodes


JimBroadbent@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top