yskripch Posted January 15, 2009 Share Posted January 15, 2009 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 More sharing options...
mbeards Posted January 17, 2009 Share Posted January 17, 2009 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:55Post Edited by Michael Beardsley at 01/17/09 07:55 Link to comment Share on other sites More sharing options...
yskripch Posted January 20, 2009 Author Share Posted January 20, 2009 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 More sharing options...
swood Posted January 30, 2009 Share Posted January 30, 2009 You would put your code in a JAR and add the JAR as a resource to the report using the scriptlet. ShermanJaspersoft Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now