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

Display Values of a Range or Varios Discrete Value Parameter 4

Status
Not open for further replies.

jcmv007

Technical User
Nov 1, 2001
88
US
Using CRW 8.5.0.217

I want to display my parameter info in a report. Users need to input a range of values or different individual values. How can I do this?

Thanks,
 
What type of parameter?

If you're using a string:

Join({?mymultiparm},",")

If a date range:

"From " + totext(minimum({?Mmydaterange}))+" to "+ totext(maximum({?Mmydaterange}))

If you need something else, please share some specifics.

-k
 
Hi Synapsevampire,

It's a number. I did convert it to a string and tried using the Join() function but I got an error message that it needed an array.

Thanks for your prompt response.

 
OK, we'll need a loop for multiples, just use the minimum and maximum above for a range.

whileprintingrecords;
numbervar x := ubound({?MyNumericParm});
Stringvar MyOutput := ""
if x > 0 then
For x := 1 to ubound({?MyNumericParm}) do(
MyOutput := MyOutput+totext({?MyNumericParm}[x],0,"")
);
MyOutput

-k
 
Synapsevampire,

I'm getting an error message saying "A Number, currency amount, boolean, date, time, date-time, or string is required here."

This are the setting on my parameter:

Value type; Number

Under Options
------------------------
Allow multiple values: Checked
Discrete and Range Values: Checked
 
Hello dgillz

Here is the formula:
Code:
whileprintingrecords;
numbervar x := ubound({?Localidad});
Stringvar MyOutput := "";
if x > 0 then
For x := 1 to ubound({?Localidad}) do(
MyOutput := MyOutput+totext({?Localidad}[x],0,"")+", "
);
MyOutput
 
You are getting the error because the parameter is set to allow ranges or multiple values. Change this line:
MyOutput := MyOutput+totext({?Localidad}[x],0,"")+", "
to
MyOutput := MyOutput+totext(minimum({?Localidad}[x]),0,"")+", "



A little extra. The following formula will display multiple ranges and discrete values - with each range/value on it's own line. You would have to add totext's where applicable.


whileprintingrecords;
numbervar loop;
numbervar times:=ubound({?param});
stringvar out;
stringvar hold;

for loop:=1 to times do(
if loop<times then (
if minimum({?param}[loop])=maximum({?param}[loop]) then
hold:= minimum({?param}[loop])&chr(13) else
hold:= minimum({?param}[loop])&&quot; to &quot; &maximum({?param}[loop]) &chr(13)) else

(if minimum({?param}[loop])=maximum({?param}[loop]) then
hold:=totext (minimum({?param}[loop])) else
hold:=minimum({?param}[loop])&&quot; to &quot; &maximum({?param}[loop])) ;
out:=out + hold
);

out


Mike
 

mbarron Thanks for your response it worked great.

Thanks also to everybody else who responded or showed interest.

James :-~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top