Dynamic height on detail band

Is there a way to set the height of each line in the detail band to be dynamic?

By that I mean I want the height of each line to adjust according to the field that becomes the highest due to the width and amount of text.

geirsv's picture
Joined: Sep 29 2006 - 3:54am
Last seen: 14 years 7 months ago

5 Answers:

Assuming you have dynamic text in text fields, you can set the isStretchWithOverflow attribute of the <textField> element to true. This will cause the text field to expand to accomodate the text.

Make sure that any elements below the text field have a positionType of "Float", otherwise the text from the text field will be displayed "on top" of the other elements.

For more information, check out my book, JasperReports For Java Developers. Available at [url=http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww... or [url=http://www.packtpub.com/JasperReports/book]directly from the publisher.

dheffelfinger's picture
Joined: Jul 17 2006 - 1:10pm
Last seen: 14 years 10 months ago

That did the trick.
geirsv's picture
Joined: Sep 29 2006 - 3:54am
Last seen: 14 years 7 months ago
I had a similar problem and this trick worked. Thanks a Ton
akgaddipati's picture
Joined: Jun 5 2007 - 5:02am
Last seen: 13 years 11 months ago
And what about images?

In my detail section, I have either a textField or an image, and I would like to adapt the band height depending on the input (say, 15 if the input is text, 340 if it is an image).

ardarico's picture
Joined: Apr 4 2007 - 6:25pm
Last seen: 14 years 1 month ago


It also worked for me..


<band height="29" splitType="Stretch">

<textField isStretchWithOverflow="true">
<reportElement x="0" y="3" width="72" height="20" uuid="61b00dae-e05c-4971-a754-f635a3043d57"/>
<textElement textAlignment="Center">
<font fontName="Tahoma" size="10"/>



maduranga.pubudu577's picture
Joined: Dec 21 2016 - 1:26pm
Last seen: 9 months 4 weeks ago