Dynamic height on detail band

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

Thanks
geirsv's picture
3
Joined: Sep 29 2006 - 3:54am
Last seen: 12 years 11 months ago

5 Answers:

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

David
dheffelfinger's picture
Joined: Jul 17 2006 - 1:10pm
Last seen: 13 years 2 months ago
0
Thanks,

That did the trick.
geirsv's picture
3
Joined: Sep 29 2006 - 3:54am
Last seen: 12 years 11 months ago
0
I had a similar problem and this trick worked. Thanks a Ton
akgaddipati's picture
Joined: Jun 5 2007 - 5:02am
Last seen: 12 years 3 months ago
0
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).

Thanks
ardarico's picture
Joined: Apr 4 2007 - 6:25pm
Last seen: 12 years 5 months ago
0

Thanx

It also worked for me..

<detail>

<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"/>
</textElement>
<textFieldExpression><![CDATA[$F{RefNo}]]></textFieldExpression>
 
</textField>

</band>

</detail>

maduranga.pubudu577's picture
Joined: Dec 21 2016 - 1:26pm
Last seen: 3 weeks 5 days ago
Feedback