Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Comma Separated Parameter Post Reply Post New Topic
Author Message
dmkanz
Newbie
Newbie


Joined: 27 Sep 2016
Online Status: Offline
Posts: 18
Quote dmkanz Replybullet Topic: Comma Separated Parameter
    Posted: 02 Jun 2017 at 10:08am
So i have a parameter that is a string that I want to allow the user to enter multiple values (i.e. 1, 12, 15)

but when I call the parameter in my Selection Formulas > Report section with an if statement it returns 1, 2, 12, 15, 5)

it seems crystal is ignoring the comma and picking every possible number

Here is my if statement

(if {?MarketTypes} <> '' then {JCJMPM.udMarketType} in {?MarketTypes}
else 1 = 1) and

Thanks DMKanz
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Jun 2017 at 8:15am
else 1=1 is killing you. I would try
if instr({JCJMPM.udMarketType}, {?MarketTypes}) > 0 then something

this code is trying to find the start of the market type in the parameter. Of course there is the problem of 1 being found in 12 and 15...so it is not perfect.

The next step, and I don't know if it is possible, is to break your input parameter into an actual array of values, and then your original code would work as long as you point it at the array that you just made.
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.039 seconds.