Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Display in a phone number format Post Reply Post New Topic
Author Message
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Topic: Display in a phone number format
    Posted: 17 Oct 2013 at 6:44am
Hi,
I've been surfing around trying to see how to get a field to display like a phone number. So instead of seeing 1234567890 on the report, you'd see (123)456-7890.

I'm pretty certain I have to do a formula to accomplish this, but one suggestion;
“Tel: (” + {BPADDRESS.TEL_0}[1 to 3] + “) ” +
{BPADDRESS.TEL_0}[4 to 6] + “-” +
{BPADDRESS.TEL_0}[7 to 10]

Doesn't work. Any other suggestions? I'm working with 2008 version.

Thanks!
Be kind to those less fortunate.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 17 Oct 2013 at 7:13am
try

“Tel: (” + totext(mid({BPADDRESS.TEL_0},1,3)) + “) ” +
totext(mid({BPADDRESS.TEL_0},4,3)) + “-” +
totext(mid({BPADDRESS.TEL_0},8,4))
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 17 Oct 2013 at 7:45am
The error comes up that the remaining text does not appear to be part of the formula.
Be kind to those less fortunate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Oct 2013 at 8:46am

another option

Picture (totext({BPADDRESS.TEL_0},0,''),"(xxx) xxx-xxxx" )
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 17 Oct 2013 at 8:49am
i think its the quotes format
try replacing them

"Tel: (" + totext(mid({BPADDRESS.TEL_0},1,3)) + ") " +
totext(mid({BPADDRESS.TEL_0},4,3)) + "-" +
totext(mid({BPADDRESS.TEL_0},8,4))
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 17 Oct 2013 at 8:55am
Bingo! That worked beautifully.
Thanks much!
Be kind to those less fortunate.
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 17 Oct 2013 at 8:56am
Oh, except the last totext statement is actually 7,4 not 8,4
Be kind to those less fortunate.
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.016 seconds.