cancel
Showing results for 
Search instead for 
Did you mean: 

Multivalue Parameter

Former Member
0 Kudos

Hi,

I have a stored procedure that has a parameter called @type. This parameter is setup to expect multiple values delimtered with a comma. The stored procedure then splits these values out and performs mutiple tasks.

My question is how can i pass mutiple values to one paramter field? eg

i would like the report to prompt asking for type, so i have a mutiple values true paramter field:

With these types available:

Type1

Type2

Type3

So the user could select Type1 and Type3 and this would get passed to the stroed procedure as Type1,Type3

Does any one have any ideas?

Many Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Steve,

CR doesn't support the passing of multi-value parameters to Commands...At least not directly.

It requires the use of an outer "shell" report that holds the multi-valued parameter and a formula converts the multi-value array into a single text string made up of all of the values separated by comas. Once you have that you can pass that value to a sub-report (aka your actual report), through a regular string type parameter, to your SP.

Check out this thread [SQL Command Parameter - Multiple Value|]... in it, Carl gives a good description of how to implement the outer report / sub-report idea and Kurt provided a link to a great sample report that really shows how it works. I added a link to a copy of Kurt's report, where I made the multi-value parameter dynamic.

The examples are using Commands instead of SPs but the principal is still the same.

HTH,

Jason

former_member207611
Active Participant
0 Kudos

CR 2008 actually supports 'multiple value' parameters on 'Command'

Read more about it on this wiki

[http://wiki.sdn.sap.com/wiki/display/BOBJ/TheBestLittleKnownFeaturesofCrystalReports2008-Part+4]

Former Member
0 Kudos

Imran,

Great find on that link!

And sorry... I should have added the caveat that it's not directly supported in any version of CR prior to CR 2008. Just bear in mind that new CR features are not backward compatible with older versions.

Jason

Former Member
0 Kudos

Many Thanks Guys, I'll take a look into this method.

Answers (0)