formatting phone number when passed as string
Posted on August 23, 2011 at 1:48pm
I am trying to format the phone number passed to the report
variable is passed as a string
in the pattern box i have
TELEPHONE pattern: <textField pattern="(###)###-####" isBlankWhenNull="true">
However this DOES NOT change the format of the field - the numbrs print out 12345614789 as opposed to (123)456-4789
Any ideas on how to alter this outcome
Joined: Jan 6 2011 - 9:11am
Last seen: 8 years 9 months ago
Posted on August 23, 2011 at 2:32pm
(phone != null && phone.length() == 10) ? "(" + phone.substring(0,3) + ")" + phone.substring(3,6) + "-" + phone.substring(6,10) : phone
in text expression field
Joined: Jan 6 2011 - 9:11am
Last seen: 8 years 9 months ago