Jump to content
Changes to the Jaspersoft community edition download ×

Word Wrapping Report Fields


tellygeorge

Recommended Posts

I am using iReport 3.7.6.

 

I have a text field that I would like to have so that if the string is stores is very long it could be wrapped onto a second or possibly third line. I would like however that there is not extra space reserve if the string can fit on one line.

I have put in to code area the XML code from the report with the particular field I want to work on

How can I get this done in JasperReports?

 

<textFieldExpression class="java.lang.String"><![CDATA[$F{bus_name}]]></textFieldExpression> [/code]

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

You can simply do this by setting two properties

1. You need to locate two properties of the text fields in the Property Window (in iReport) namely, Stretch With Overflow = true and Stretch Type = 'Relative to the tallest'(This property is also set for all the other elements in row, to simultaneously take the height of the larger element which will maintain the uniformity and also help in seemless XLS output.)
Or in terms of XML you need to set this property 

<textField isStretchWithOverflow="true">
<reportElement uuid="99cc5ce6-e225-4f2d-978c-9dab78f0ffc0" stretchType="RelativeToTallestObject" x="402" y="40" width="294" height="14"/>
 
2.  If done via iReport, you just need to set these two and word wrap will work like a charm.
 
Hope that this help
 
Link to comment
Share on other sites

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