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

Variable selection criteria? 1

Status
Not open for further replies.

Paul12345671

Technical User
Dec 3, 2006
15
AU
Hello,
I have a report that I'm generating to run in JRC. We have an early version of JRC that crashes if I use SQL expressions, so I'm limited to using formulas.

We operate in a state that is broken down into fixed regions. I would like the user to enter a parameter indicating which region the report should be run against. The entire state is selectable as one of the 'regions', in which case the report should be run against all regions.

I have used the following formula (called stateTest), which works fine if a user selects a region, but does not work if the user selects a state (i.e. the report returns no data).

if ({?regionCd}) = 12 then
formula = "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]"
else
formula = "[" & {?regionCd} & "]"
end if

In the selection formula, I have:

... and cstr({SALES.REGIONCD}) like {@stateTest}

Is there any suggestion on how to select all regions if the report receives the 'state' parameter?

I have CR XI, running in windows XP, which I then call from a Java application (under Windows Server 2003).

Thank you,

Paul.
 
Hi,
Is {?regionCd} = 12 the one that means the entire state is chosen?

If so,then try this as a record selection formula
( If {SALES.REGIONCD} is a Number field, make the parameter type a number):

If {?regionCd} = 12
Then
True
Else
{SALES.REGIONCD} = {?regionCd}

(If you want a multivalue parameter then could use something like:

If {?regionCd} = 12
Then
True
Else
{SALES.REGIONCD} IN {?regionCd}






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top