views:

4037

answers:

5

how do i stretch a row when data overflows the band height in jasper reports, I have set the stretch with overflow flag as true but it doesn't work.

+1  A: 

My band stretches if necessary with the following conditions, I do not know yours. I have started with the ireport 1.0 netbeans plug-in and jasper 3.5.2. The Split type for the band has been set to Stretch.

<band height="108" splitType="Stretch"></band>

The Stretch with overflow for the field has been checked, e.g.:

<textField isStretchWithOverflow="true">
    <reportElement positionType="Float" x="70" y="28" width="485" height="14"/>
     <textElement>
      <font size="10"/>
     </textElement>
     <textFieldExpression class="java.lang.String"><![CDATA[($F{EQUIPMENTS} == null ? "-" : $F{EQUIPMENTS})]]></textFieldExpression>
</textField>
rics
Thank you for your reply..., I use Ireport 2.0.5 to generate jrxml file and use the same in my java web propject, I have used all the flags to stretch to fit the data, but it doesn't work...
The textfield to be stretched..<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement style="dNew" mode="Opaque" x="55" y="0" width="55" height="19" key="value-1" stretchType="RelativeToTallestObject" positionType="Float" isPrintWhenDetailOverflows="true"/> <box></box> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{value1}]]></textFieldExpression> </textField>
2.0.5 is fairly old, so you may try it with a newer version.
rics
A: 

I ran into this problem myself. I could not get the detail band to stretch, even though the text field in the band was configured to do so. The problem was with the report's Print Order property, which for some reason had been set to horizontal. When I changed it to vertical, the problem went away. According to the JasperReports Ultimate Guide, "When filling report templates horizontally, dynamic text fields inside the detail section no longer stretch to their entire text content, because this might cause misalignment on the horizontal axis of subsequent detail sections".

mike
A: 

Mike, I changed the print order property to horizontal and it worked like a charm! Thanks.

gill
A: 

how you do this change in java code not in IReports. The JRXML file remains unchanged. Thanks

Nic
A: 

thanks.. it helped

Arthemia