Jump to content
Changes to the Jaspersoft community edition download ×

String Field Formatting

Recommended Posts

By: Tom Schneider - cs2

String Field Formatting

2003-05-04 12:56

I have a string field "123456789" that represents a Social Security Number. I tried using patterm="###-##-####" for format the field for the report. This does not work. Any ideas? I also need to format phone numbers.





By: Stephane Houle - stephoule

RE: String Field Formatting

2003-05-05 12:24

You can do some Java code in your textFieldExpression tag... Something like this:


ssn.substring( 0, 3 ) + "-" + ssn.substring( 3, 5 ) + "-" + ssn.substring( 5, 9 )


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...