Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: format to get parenthese instead of minus sign Post Reply Post New Topic
Author Message
donalexander
Newbie
Newbie


Joined: 05 Oct 2013
Location: United States
Online Status: Offline
Posts: 3
Quote donalexander Replybullet Topic: format to get parenthese instead of minus sign
     Posted: 05 Oct 2013 at 7:04pm
Hello,

I am using Crystal Reports XI and I have a string field giving me sales amount (@SalesAmount - this is an invoice/credit memo report). When there in invoice display it will show the invoice amount (no problem here), but when the credit memo is displayed I get a minus sign for example -253.12, what I really want is (253.12) instead. How can I get the parentheses to show I there is no number tab in the format editor. Below is my code.  Thank you in advance.

WhilePrintingRecords;
if PageNumber <> TotalPageCount then
"**********"
else if OnLastRecord OR ({tarPrintInvcHdrWrk.InvcKey} <> Next ({tarPrintInvcHdrWrk.InvcKey}))then
ToText ({@SalesAmount}, {tarPrintInvcHdrWrk.MCDecPlaces} )
IP IP Logged
lolly54
Groupie
Groupie
Avatar

Joined: 25 Sep 2011
Online Status: Offline
Posts: 58
Quote lolly54 Replybullet Posted: 06 Oct 2013 at 10:12pm
if the field is a number, you can right click on it and select [Format Field].
Then go to the [Number] tab.
You can select the (1123.00) or (1,123.00) format. Wink
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 07 Oct 2013 at 5:03am
do the simple thing...you know it's a number it is just formatted as a string...

write a formula like:
val({table.field})

now you can format it as a number

HTH
IP IP Logged
donalexander
Newbie
Newbie


Joined: 05 Oct 2013
Location: United States
Online Status: Offline
Posts: 3
Quote donalexander Replybullet Posted: 07 Oct 2013 at 8:46am
Thanks!
IP IP Logged
donalexander
Newbie
Newbie


Joined: 05 Oct 2013
Location: United States
Online Status: Offline
Posts: 3
Quote donalexander Replybullet Posted: 07 Oct 2013 at 8:46am
Thanks anyway, but there is no number tab. This is a string.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Oct 2013 at 4:51am
yes, that is what you convert it to a number in a formula. when you place the formula on the report then format the formula.
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