Multiple Value parameter not working

Getting error 'A String is required here'

The Parameter (?StandardComments) is setup as a string.. with multiple values

1.Line1 has been chosen
2.Line2 has been chosen
3.Line3 has been chosen
4.Line4 has been chosen

I have created a Formulas based on the parameter

if {?StandardComments}
startswith '1.' then cstr(mid({?StandardComments},3,100))
else if {?StandardComments}
startswith '2.' then cstr(mid({?StandardComments},3,100))
else if {?StandardComments}
startswith '3.' then cstr(mid({?StandardComments},3,100))
else if {?StandardComments}
startswith '4.' then cstr(mid({?StandardComments},3,100))

Why won't this work.. It will work without multiple values
Michael KatzAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
What is the formula supposed to do?

When you have a multiple-value parameter, it is implemented as an array thus it is not a string but rather an array of strings.

You need to work on the individual elements of the array using an index  {?Standard Comments}[1]

mlmcc
0
Michael KatzAuthor Commented:
I want the list of values to be available and then if more than one is selected for them to appear in report..
0
Michael KatzAuthor Commented:
Can you help me script that?
0
Michael KatzAuthor Commented:
I think I got it

Making the Parameter optional as well


if  HasValue({?StandardComments})then

join({?StandardComments},chr(13) )
else ''
0
mlmccCommented:
That should do it.

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.