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

parameter where a user can select "ALL" or "one division"

Status
Not open for further replies.

shams100

MIS
May 2, 2008
24
US
Any help will be appreciated:

I need a parameter where a user can select "ALL" or "one division"

So I create {?division} parameter and Added "All" to the values list

and Under record selection Formula I added the below code:

if {?division}<>"ALL" then
{a.division} = {?division}
else
If {?division}= "ALL" then
{a.division} = "DivisionA"
or
{a.division} = "DivisionB"
or
{a.division} = "DivisionC"
or
{a.division} = "DivisionD"
But this code not working if user picl up "ALL" but it is working for one division.
 
Try it like this:
Replace All with *

If
{?division} = '*' then {a.division} Like '*'
else
{a.division} like {?division}


Assuming your parameter value looks like below

*
DivisionA
DivisionB
DivisionC
DivisionD



Julie
CRXI CE10 / RS2005 Sql DB
 
Write the logic in the Record Selection formula like this:

(
if {?division} <> "ALL" then
{a.division} = {?division}
else if {?division} = "ALL" then
True
)

~Brian
 
Thank you very much This is working!

Another issue show up:

There are other parameters come as array field separated buy comma EX: [Children, Adults, Toddlers]
So If user pick up Children will need to show all records which Age field has Children

If user pick up All it should return all Records


I created a formula for Age

stringvar e;
if instr(e,{a.arrAge}) = 0 and {?Age} = split({a.arrAge},",") then
e := e + {a.arrAge}+", "
;

{a.arrAge} in e

I don't know what to add under the report Selection
 
I solved the first part which if user pick up one value: I created @Age formula <<
numbervar a;
stringvar e;
if instr(e,{a.arrAge}) = 0 and
{?Age}= split({a.arrAge},",") then
e := e + {a.arrAge}+", ";
{a.arrAge} in e

>>
and I added the formula in the report record selection. And this is working fine but

I really need help to modify this code to make it work if user puck up ALLcode to make it work if user pick up "ALL
 
Try:

numbervar a;
stringvar e;
if instr(e,{a.arrAge}) = 0 and
{?Age}= split({a.arrAge},",") then
e := e + {a.arrAge}+", ";
if {?Age} = "All" then
true else
{a.arrAge} in e

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top