Skip to Content
Former Member
Nov 19, 2009 at 04:24 PM

Left formula not working during runtime


I am working with Visual Studio 2008, Version 3.5, SP 1with Crystal Reports Basic on a Microsoft SQL Server 2005. In the database the phone field has a data type of numeric. I have added the following formula to convert the number to display a phone format: Example: Phone: 561027799


Mid (ToText({ADDRESS_MASTER.PHONE}), 4,3)'-'


I have also tried:

If Length (ToText({ADDRESS_MASTER.PHONE}))= 10 then Picture (ToText({ADDRESS_MASTER.PHONE}), "xxx-xxx-xxxx" ) else ToText({ADDRESS_MASTER.PHONE})

Both of these work in the Crytal Reports Design Viewer correctly. When I view it on my local host web site, it shows up something like this:


Other formulas are working correctly so I feel it has something to do with converting that field to text.

Any suggestions on what to look for would be appreciated.