Troubleshooting


Formatting Phone Numbers

I need phone numbers that are stored in the underlying database as 5554161010 to display as (555)416-1010. Is this easily accomplished?

Yes. The simplest method to accomplish this is through the Display String functionality accessed under the Common tab of the Format Editor. You can access this dialog by right-clicking on the Telephone_Number field in your report and selecting the Format Field option. Once here, click on the x+2 button beside the Display String title (way down near the bottom of the dialog) and enter something like the following to accomplish your goal:

    "(" + Left (CurrentFieldValue,3) +     ") " + Mid(CurrentFieldValue,4,3) +     "-" + Right(CurrentFieldValue,4)


Or use:

    Picture (CurrentFieldValue, "(XXX) XXX-XXXX")





Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net