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

Mutiple value parameters problem

Status
Not open for further replies.

rrgkanth

Programmer
Nov 16, 2005
35
US
Hi,

Using CR XI. I have a dynamic cascading prompt - 3 mutiple value parameters. 2 of these are strings. One is a number.

In my selection criteria, I am building it as a formula by checking for 'all' conditions in each of them. therefore whenever a particular parameter is not an all, i add a condition
fieldname = [{?parameter}] (if its a string) and
fieldname in {?parameter} (if its a number).

The number part works, the other 2 dont work in the selection. I am able to retreive data only for one of the selected values.

I tried to display the parameter value using a formula
Join({?parameter},", ")
but i get an error - 'a string array is required here'

I dont know y its behaving this way.

Any help would be greatly appreciated.

Thanks,
Rrgkanth.
 
I figured it out. Unnecessary confusion. I just changed everything to = and it worked alright.

The next problem however is using 'All'.

Ive seen the prompting.rpt example that installs with CRXI. basically lets you select All in a dynamic cascading prompt of Country->Region->State.
If this were converted to allow multiple values. I see values repeating in the next box.

The query used is an set of unions. so, if i select 2 option for country, my 'All' gets repeated twice in the region box.

Anyone got an idea on how i can do this?

Regards,
Rrgkanth.
 
Hi,

This is the query used:

SELECT Country, Region, City
FROM Customer
UNION
SELECT Country, Region, '...All'
FROM Customer
UNION
SELECT Country, '...All', '...All'
FROM Customer


This is the selection formula:

if {?Country} = '...All' then
{Orders.Employee ID}={?Employee}
else if {?Region} = '...All' then
{Orders.Employee ID}={?Employee} and
{Customer.Country} = {?Country}
else if {?City} = '...All' then
{Orders.Employee ID}={?Employee} and
{Customer.Country} = {?Country} and
{Customer.Region} = {?Region}
else
{Orders.Employee ID}={?Employee} and
{Customer.Country} = {?Country} and
{Customer.Region} = {?Region} and
{Customer.City} = {?City}
UNION
SELECT '...All', '...All', '...All'
FROM Customer


Now, if I changed the Country parameter to accept multiple values, then I see 'all' twice in the region list.
 
Try this, it includes the use of multiple, discrete, and range, but also spans numbers and text field types.

whileprintingrecords;



global numbervar increment;

//increments the loop so that all parameter entries can be displayed



global stringvar output := "";

//creates a string "running total" so that all entries can be displayed



for increment := 1 to count({?Project Number}) do

(

if minimum({?Project Number}[increment]) = maximum({?Project Number}[increment])

then (output := output + (Minimum({?Project Number}[increment]) + chr(10);))

else (output := output +(Minimum({?Project Number}[increment]) + ' to '

+ (Maximum({?Project Number}[increment])) + chr(10););

);

);

output;

 
MuffnTuff,

Thanks for the reply. How do I use this formula in controlling values that dynamically popup for my parameters?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top