Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Changing how a field is displayed Post Reply Post New Topic
Author Message
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Topic: Changing how a field is displayed
     Posted: 29 Oct 2009 at 12:24pm
I have an asphanumeric field which displays data like this: 009AMO142597664507
 
I would like to somehow display it like this:
009-AMO-1425-9766-4507
 
I would also like to know if it is possible to split the data up on the Crystal Report by bringing the data into seperate fields.
 
Thanks.
Crystal Reports XI
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Oct 2009 at 12:45pm
One way:
left({table.field},3) + '-'+ mid({table.field},4,3)+'-'+
mid({table.field},7,4)+'-'+ mid({table.field},11,4)+'-'+ right({table.field},4)
 
to seperate the fields just create a different formula from each part:
Formula1=left({table.field},3)
formula2=mid({table.field},4,3)
etc.
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 29 Oct 2009 at 1:07pm

Thanks DBlank. I was able to get the first formula to work, which I named ‘AlphaNum’. Here’s the formula based on what you mentioned:

 

left({POLINE.GLDEBITACCT},3) + '-'+ mid({POLINE.GLDEBITACCT},4,3)+'-'+

mid({POLINE.GLDEBITACCT},7,4)+'-'+ mid({POLINE.GLDEBITACCT},11,4)+'-'+ right({POLINE.GLDEBITACCT},4)

 

But the next formula is getting an error message saying ‘The remaining text does not appear to be part of the formula’.

 

What I did was create a new formula and named it ‘Formula1’. Here’s the formula based on what you mentioned:

 

Formula1=left({POLINE.GLDEBITACCT},3)

 

I also tried:

 

AlphaNum=left({POLINE.GLDEBITACCT},3)

Formula1=left({POLINE.GLDEBITACCT},3)

Formula1=left({@AlphaNum},3)

 

But still get the same error message. I am sure it’s something very simple I am overlooking.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Oct 2009 at 1:20pm
Sorry just use:
left({POLINE.GLDEBITACCT},3)
 
I was using the "Formula1=" as showing the name but it is not part of the formula.
Bad posting on my part Thumbs%20Down


Edited by DBlank - 29 Oct 2009 at 1:20pm
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 29 Oct 2009 at 1:24pm
I may never have figured that one out without clarification. Thanks again for you help DBlank.
IP IP Logged
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