Jump to content

Field formatting


yskripch

Recommended Posts

Hello all,

I have a problem that the string that I am retrieving from the database is very long. It can be over 1000 characters and it does not have any white spaces. The problem is that I cannot make a field big enough to cover the full string. I would like to be able to insert white space or new line characters into the string so that JasperReports would wrap the string on the white spaces. If anybody knows how to do this, please let me know. I have been trying to come up with a way for a couple of weeks and still have not managed to find one. Thanks for all the help.

 

Yuriy

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Yuriy,

You could use a Scriptlet. For example, using Jakarta Commons Lang:

 

Code:

Then, you'd use it in your JRXML template something like:

Code:



Post Edited by Michael Beardsley at 01/17/09 07:55



Post Edited by Michael Beardsley at 01/17/09 07:55
Link to comment
Share on other sites

Ok. That sounds great.

 

Where should I put the code for the scriptlet you posted? Sorry for such a simple answer but I am new to reporting software and web developemt languages.

Also, you are importing "import org.apache.commons.lang.WordUtils;" do I need a class or jar in my apache to have this work? Thanks, I appreciate all the help.

Link to comment
Share on other sites

  • 2 weeks later...

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...