Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: pad string in crystal report Post Reply Post New Topic
Author Message
krish
Newbie
Newbie


Joined: 04 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote krish Replybullet Topic: pad string in crystal report
     Posted: 04 Aug 2011 at 1:02am
Hello ,

I am having problem to pad string in Crystal report.
Ex: I have a field like this :"6160-Rates and Rents".

I need to get only "Rates and Rents". How can i do this?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Aug 2011 at 3:07am

If the beginning part will always be 5 characters, try something like this:

Right({table.myfield}, length({table.myfield}) - 5)
 
If it can be a variable number of characters and there will always be a "-", you could do something like this:
 
Right({table.myfield}, length({table.myfield}) - InStr({table.myfield}, '-'))
 
-Dell
IP IP Logged
krish
Newbie
Newbie


Joined: 04 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote krish Replybullet Posted: 04 Aug 2011 at 10:45pm
Hello Hilfy,

I tried to put this on format field- tooltip(formula). But it didn't work there. It doesn't show any error thou.
Where do i have to assign this?

Thanks
Krish
IP IP Logged
krish
Newbie
Newbie


Joined: 04 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote krish Replybullet Posted: 06 Aug 2011 at 10:50pm
Hello,

I tried again . It is working internally .But in preview screen its showing same old values . And when i put my cursor on any row in preview tab its showing the exact output .

don't understand where i am missing?

Thanks
IP IP Logged
krish
Newbie
Newbie


Joined: 04 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote krish Replybullet Posted: 07 Aug 2011 at 12:15am
thanks .. It worked!!!:)
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