Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Tables and formatting number fields Post Reply Post New Topic
Author Message
Twalker
Newbie
Newbie


Joined: 04 Mar 2008
Location: Canada
Online Status: Offline
Posts: 10
Quote Twalker Replybullet Topic: Tables and formatting number fields
    Posted: 21 Aug 2008 at 8:12am
Table field layouts and formatting number fields seemed be the two things I struggle with in Crystal.
 
There has be an easy method to get fields formatted nicely within a table layout for example a grid.  Without have to drag individual text boxes and struggle with getting them aligned properly.  I can hear the excel power users laughing at me. :)
 
Formatting numbers field into a regional telephone format.  Is there no way to apply a data format string to a numeric field to display it in a telephone format?  Beyond having to separate each element into parts and building the back together using crystal basic string commands. 
 
I just spent the better part of day researching for the answer online without any luck.
 
Any sugguestions would be appreciated.
IP IP Logged
Twalker
Newbie
Newbie


Joined: 04 Mar 2008
Location: Canada
Online Status: Offline
Posts: 10
Quote Twalker Replybullet Posted: 21 Aug 2008 at 9:03am

Here is crystal basic code I had to create in order to format a number into a proper telephone format.

If(Length(Replace(LEFT(CStr({CustomerOrders.PhoneNumber}),LENGTH(Cstr({CustomerOrders.PhoneNumber}))-3),",","")) > 9) THEN
    Picture(Replace(LEFT(CStr({CustomerOrders.PhoneNumber}),LENGTH(Cstr({CustomerOrders.PhoneNumber}))-3),",",""),"(xxx) xxx-xxxx")
ELSE
    Replace(LEFT(CStr({CustomerOrders.PhoneNumber}),LENGTH(Cstr({CustomerOrders.PhoneNumber}))-3),",","")

If anyone has a better method I would love to see it.
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.031 seconds.