Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Concatenate Multiple Parameters Into One Variable Post Reply Post New Topic
Author Message
vcs1161
Newbie
Newbie


Joined: 03 Mar 2010
Online Status: Offline
Posts: 33
Quote vcs1161 Replybullet Topic: Concatenate Multiple Parameters Into One Variable
    Posted: 12 Jan 2015 at 4:06am
I have a stored procedure where I would like it to accept multiple parameters into my Crystal report.  I have it working where I have to populate the Crystal parameter with the values separated by a comma.  But I would ideally like to have the end user select each value from a list of choices and that in turn to concatenate the selected multiple values separated by a comma so the stored procedure variable can be used that way. 
This logic works to capture multiple values in my stored procedure based on the Crystal parameter field I have. But we have to enter the values like this:
 
Stored procedure @Parameter = value1,value2,value3, value4 (coming from the Crystal parameter)
 
Which forces the user to know what they are rather the select from a provided list of choices.
 
(@Parameter = "*ALL" or charindex(ltrim(rtrim(database_value))+",", ltrim(rtrim(@Parameter ))+",") > 0)
 
Any suggestions is greatly appreciated or if anyone has come across this and can share what has worked for you. 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 12 Jan 2015 at 7:14am
yeah, this is a tough one, as Crystal controls this part, and a list is an array, and crystal passes only the first value of the array to a stored procedure.

The way I got around it...if you are calling the report from application, is to have the application present the list, let the user select what they want, have the application comma separate them and go from there.

As far as I know, straight out of Crystal, you are out of luck on getting the user to select from a list and sending as a comma delimited string.
IP IP Logged
vcs1161
Newbie
Newbie


Joined: 03 Mar 2010
Online Status: Offline
Posts: 33
Quote vcs1161 Replybullet Posted: 19 Jan 2015 at 4:10am
Darn.  Thank you for your time.
IP IP Logged
Vimal Nair
Newbie
Newbie
Avatar

Joined: 29 Dec 2014
Location: United Arab Emirates
Online Status: Offline
Posts: 26
Quote Vimal Nair Replybullet Posted: 27 Jan 2015 at 6:55pm
If you are using BVM for multiple parameter values and wan to just display the parameters selected by the user, simple formula can be used

DisplayParameter:= Join({?Parameter},",")

This will display the multiple values selected by the user with comma separation.
Born To Live
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.