Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using Left Command on Parameter Value? Post Reply Post New Topic
Author Message
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Topic: Using Left Command on Parameter Value?
    Posted: 13 Sep 2018 at 5:14am
My intent is to scan a bar code from an external source into a Crystal Report as a parameter. The barcode has 36 digits as its value. I want to determine what the first three are so i can use that info in an if/then/else formula. I have tried using the LEFT Command to no avail.

LEFT({?barcode},3)

giving this result
{?b

Does anyone have any direction as to how to accomplish this.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Sep 2018 at 4:59am
what data type are you setting {?barcode} up as?
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Posted: 14 Sep 2018 at 5:18am
{?barcode} is set up as a string.
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Posted: 14 Sep 2018 at 5:19am
The bar codes that i'm scanning have alphanumeric values.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Sep 2018 at 5:21am
I think the issue is that you are not actually getting a scanned value into the report parameter result. I am not sure how to connect a scanned item to an input of the param.
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Posted: 14 Sep 2018 at 5:35am
I also use a multiple value parameter to get the barcode data populated into {?barcode}. When this is used and the {?barcode} is added to my crystal report that accurate 16 digit value of the barcode is displayed. I just want to be able to manipulate that 16 digit value to evaluate it and then cut off the parts i want.
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Posted: 14 Sep 2018 at 5:52am
I realize that all of this is probably not necessary but i ended up getting the desired outcome by having variable be equal to the value of {?barcode}. Then the LEFT command worked. I use this formula without the left command when i want to display all the values assigned to a multiple value parameter.

left(

(numbervar max := count({?barcode});

numbervar k := 1;

stringvar output := "";

for k := 1 to max do

(

output := output +{?barcode}[k]+", "

);

numbervar m := len(output);

left(output,m-2))

,3)
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.031 seconds.