[#11311] - TextField with isStretchWithOverflow=true not stretching correctly

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Minor
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:
0

In some very specific conditions and circumstances the TextField with isStretchWithOverflow="true" does not stretch appropriately to display whole contained text, at least if exported to PDF, which interests me the most. This bothers me a lot because an appropriate field stretching is one of the feature I rely heavily on.

The attached report is based on the Stretch demo sample from the 6.7.0 version of the JasperReports library. There are textfields like the following:

<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="117" height="15" isRemoveLineWhenBlank="true" uuid="2404e8f9-226b-40e9-ad60-9fc46db0cced"/>
<box>
<pen lineWidth="0.5"/>
</box>
<textElement>
<font size="10" fontName="Sans"/>
</textElement>
<textFieldExpression><![CDATA["Svotfuk Stalopal, Ih.D Pn.g (100%) – 0123456789"]]></textFieldExpression>
</textField>

The used font family named Sans is a font extension using Liberation Sans True Type font. The font extension definition and TTF files are also included.

In order to run the sample it is necessary to unpack the attached ZIP file to demo/samples directory of the JesperReports project.

AttachmentSize
Package icon stretch_bug.zip410.36 KB
v6.7.0
Holy's picture
2
Joined: Feb 1 2010 - 6:49am
Last seen: 2 months 2 weeks ago

2 Comments:

#1
  • Resolution:Open» Fixed
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

Add this property to your JRXML or add it to jasperreports.properties, to set it globally:

<property name="net.sf.jasperreports.export.pdf.force.linebreak.policy" value="true"/>

You can read more about it here:

http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasper...

I hope this helps.
Teodor

#2

It seems it really helped. Thanks a lot.

Feedback
randomness