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

Multiple string parameters in PH

Status
Not open for further replies.

stillsteam

Programmer
Apr 2, 2004
52
0
0
SE
Hello
I'm trying to display multiple parameters in the pageheader but somehow I can't get it to work. I've tried with the formulas in the FAQ but they don't work. I'm not that good at writing formulas so it is probably me who can't adapt them to my needs.
There is no problem if there is a range parameter with the minimum and maximum, it displays fine.
It is string parameters.
I am using CR 8.5 and a SQL-server
Please help!

TIA
Jonas
 
Supposing you have a string parameter that can have multiple values, it should be sufficient to create a formula such as:

local numbervar i;
local stringvar s;
for i:=1 to ubound({?P1}) do
s:=s & {?P1} & chr(13);
s;

and place it in your page header. Do not forget to replace P1 with the name of your parameter and to make sure that the field's "can grow" option is properly checked.
The formula will concatenate all of your parameter's values to a string and then display it. Keep in mind that using CR8.5 your output is likely to be restricted to 255 characters (including the chr(13)s). So depending on the quantity and length of your values you might not be able to display everything you need. But perhaps somebody else comes up with another solution.

Regards
 
Thanks
BUT I get message saying "An array is required here" and it places the curser right next to my parameterfield
local numbervar i;
local stringvar s;
for i:=1 to ubound( {@Vilka varugrupper}) do
s:=s & {@Vilka varugrupper} & chr(13);
s;

Any ideas?
 
hm, that's strange. I tested this with our CR8.5 installation and it worked....
The message you're getting sounds like the parameter field you're using might not be set up properly i.e. you may not have choosen "multiple values" available for this parameter.
Another thing that confuses me a little bit is the fact that the fieldname you're using contains '@' instead of '?', so you're referring to a formula field and not a parameter field.
Set your parameter field to 'multiple values' and replace {@vilka varugrupper} with the correct name.
 
Oh sorry
I used the wrong field but still got a message saying "amount bolean....is requested here" but then I saw in the parameter it was checked Discrete and Range value, so I checked Discrete Value it worked great

Thank you very much
Think I need a break from work right now...lol

Jonas
 
Hello again

Is it possible to add to this formula so that I can use Discrete and Ranged Value in my report?

TIA
Jonas
 
Do you mean you want to check "allow multiple values" and then choose "discrete and range values" from the radio buttons?
If so, this might get a little bit tricky.
You could try something like the following:

local numbervar i;
local stringvar s;
for i:=1 to ubound({?P1}) do
if (minimum({?P1})<>maximum({?P1})) then
s:=s & minimum({?P1}) & " to " & maximum({?P1}) & chr(13)
else
s:=s & minimum({?P1}) & chr(13);
s;

This did work when I tested it with a string parameter. It might be neccessary to do some field conversions when dealing with dates or numbers.
But perhaps either somebody else has done something similar or you'll find some document in the knowledgebase.

Kind regards.
 
Works like a charm

Thank you very much!

/Jonas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top