Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Build Array from Parameter with Multiple Values Post Reply Post New Topic
Author Message
vcs1161
Newbie
Newbie


Joined: 03 Mar 2010
Online Status: Offline
Posts: 33
Quote vcs1161 Replybullet Topic: Build Array from Parameter with Multiple Values
    Posted: 29 Aug 2012 at 3:06am
If I have a parameter in my Crystal report that can accept multiple values, is there a way to build those choices into an array and use in my SQL code?  So if the user selects 1,2,3, and 4 from the parameter I would like to pass that as an array to use in my SQL code.  An example of my SQL code:
 
select
*
from
tablename
where
id in ({parameter name}) ** this is where the array would be based on the parameter select in Crystal.  This array would be 1,2,3,4 to be used in my SQL.
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 29 Aug 2012 at 3:22am
You don't have to convert it to an array - Crystal will automatically do that for you.  If you're using a command, you need to delete the parameter from the report and recreate it in the command (which will create it in the report with a few additional underlying properties that regular parameters don't have.)  You then use it in your Command like this:
 
where id in {?parameter name}
 
Note: NO parentheses around the parameter!
 
-Dell
IP IP Logged
vcs1161
Newbie
Newbie


Joined: 03 Mar 2010
Online Status: Offline
Posts: 33
Quote vcs1161 Replybullet Posted: 29 Aug 2012 at 3:39am
Oh my goodness.  That was it!  Was that Allow Multiple Values checkbox something new in the XI version?  I swear I could not do this before.
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.