Print Page | Close Window

Comma Separated Parameter

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22320
Printed Date: 05 May 2024 at 5:24pm


Topic: Comma Separated Parameter
Posted By: dmkanz
Subject: Comma Separated Parameter
Date 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



Replies:
Posted By: lockwelle
Date 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.



Print Page | Close Window