Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to manipulate a number from a string Post Reply Post New Topic
Author Message
duffey01
Newbie
Newbie
Avatar

Joined: 04 May 2009
Location: Australia
Online Status: Offline
Posts: 39
Quote duffey01 Replybullet Topic: How to manipulate a number from a string
     Posted: 14 Jun 2009 at 7:01pm

Hi All

I am using CRXI and have designed a report that will list all of our fleet starting with the 'Fleet No.' The fleet no field is a string so that the fleet no.s weren't displaying in number order. I converted the field to a number and it then worked fine. Now, of course, the boffins have decided to create new fleet no.s '7110.1' Of course these weren't displaying on my report. I thought if a played with the 'decimal points' that would help. My report now has '101.0' insted of '101 as well as displaying '7110.1' Is there a formula to suppress the decimal point if it is zero?

 

Thanks in advance for your help

 

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Jun 2009 at 7:05am

Not sure how you have this designed but why not use your formula field that is numeric for the sort but display the original text field that should not have the problem you are indicating?

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 15 Jun 2009 at 7:21am
Hi
 
You can try using the formula below
 

if {table.field}=truncate({table.field},0) then 0

else if {table.field}=truncate({table.field},1) then 1
 
else if {table.field}=truncate({table.field},2) then 2
 
else 3
 
Right click the field where you want decimals,then format field select Custom Style Click the x+2 against the decimals and enter the above formula
 
cheers
Rahul


Edited by rahulwalawalkar - 15 Jun 2009 at 7:22am
IP IP Logged
duffey01
Newbie
Newbie
Avatar

Joined: 04 May 2009
Location: Australia
Online Status: Offline
Posts: 39
Quote duffey01 Replybullet Posted: 15 Jun 2009 at 5:12pm
Hi DBlank
 
Sorry to sound totally thick, how would I go about doing this? Sounds like it would solve a number of problems.
 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jun 2009 at 7:23am
I am guessing that you are grouping on this field. Continue to group on the numeric formual field, supress it and drop the original field in the header, and it should work fine. It will not change the group tree (if you have one) but the numbers should still be clear. You can also format this field as needed to make it appear as a group header field. If you are using it somewhere else or in some other way please give a description and we can try to figure out how to address it.
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