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!

Displaying Multiple Parameter Values > 255 Characters 1

Status
Not open for further replies.

M8tt

Technical User
Feb 11, 2003
43
NL
I have a String Parameter field set to have discrete, multiple values which I need to display on the header of my report.

I've achieved this with the following formula....

join({?Solver Group},chr(13))

.... and that works fine until many values are selected and the combined lengths of those values start to exceed 255 characters in length. At which point I get an error.

I've tried various ways to fix it but am not having much joy.

I am using CR8.5 and understand the 255 char restriction on string fields is addressed in higher versions, however I'm sure there must be a way around this so any help would be appreciated.

Many Thanks, Matt

 
In 8.5, the only way round is to place the fields separately in a text box.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Are you saying I can extract the various values of the parameter array out and show them in seperate fields?

If so can you advise how I would go about doing this? I can get the highest/lowest values using maximum/minimum but have been unable to get at the values between them.

Many Thanks, Matt
 
You can treat the elements as separate fields, Split({item}, " ")[1] and so on. Put this in a formula field and the formula field in a text box.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc,

Sorry, I'm being a bit thick here but when I try....

Split({?Solver Group}, "")[1]

.... as you suggest, I get the following error:

This array must be subscripted. For example Array.


Can you tell me what I'm doing wrong?

Thanks again, Matt
 
I wonder if you could parse this into separate formulas as in:

//{@1stset}:
left(join({?Solver Group},chr(13)),255)

//{@2ndset}:
mid(join({?Solver Group},chr(13)),256,255)

//{@3rdset}:
mid(join({?Solver Group},chr(13)),511,255)

//etc.

Then drop them in a text box and format it to "can grow".

-LB
 
Nice idea but unfortunately not - I still get the same error, presumably because Crystal is making the 'join' calc before the 'left' calc and therefore hitting the 255 limit.
 
Thanks for the suggestions and I have found a way around this by using subscript to return the data from the array in 2 seperate lots (as I know it doesn't exceed 2 lots of 255) in 2 seperate formulas.

The first:

whileprintingrecords;
stringvar SG1;
numbervar cnt:= ubound({?Solver Group});
numbervar lastSG1element;
numbervar x;
for x:= 1 to cnt
step + 1
do
(if len(SG1) + len(totext({?Solver Group}[x])) < 255
then SG1:= SG1 + totext({?Solver Group}[x] + chr(13));

if len(SG1) + len(totext({?Solver Group}[x])) < 255
then lastSG1element:= x);
stringvar SG1;

And the second:

whileprintingrecords;
stringvar SG2;
numbervar cnt:= ubound({?Solver Group});
numbervar lastSG1element;
numbervar x;
for x:= lastSG1element to cnt
step + 1
do
(if len(SG2) + len(totext({?Solver Group}[x])) < 255
then SG2:= SG2 + totext({?Solver Group}[x] + chr(13));
stringvar SG2;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top