[#12071] - Using linespacing on TextField looses the last line of text when stretched

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

Jasper seems to use some sort of calculated line spacing which gives to much white area when text need to be compressed to save paper as well fitting as much text as possible in a frame.

Configuring linespacing attribute to Proportional and a value of 0.5 looses the last line when the element is stretched hence legal information and so forth are lost and not displayed. See attached image when previewed in Jaspersoft Studio where you see that java generates the text correctly, while using the PDF previewer looses the last line.

I have tested this with some different versions of jasper (6.6, 6.7, 6.8, 6.9) and even the AGPL version (jasperreports-pdf-lib5), and they all looses the last line when exporting to a PDF.

Here is a sample JRXML file which could be used to reproduce the problem:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true" uuid="7941b5f6-2c9c-458e-ad67-c4b6d9d066ff">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<detail>
<band height="30" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="201" height="30" uuid="e82b3889-2328-49e8-a2e9-ab068348640f"/>
<textElement>
<font fontName="Arial" size="12"/>
<paragraph lineSpacing="Proportional" lineSpacingSize="0.5"/>
</textElement>
<textFieldExpression><![CDATA["Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas et tortor at lorem malesuada mollis. In hac habitasse platea dictumst. Vestibulum laoreet ultrices libero sed tristique. Sed vulputate velit sed sem suscipit, at rutrum diam accumsan. Proin maximus ante sed mattis pellentesque. Etiam dapibus et ante fermentum tincidunt. Maecenas imperdiet quis nunc in maximus. Lorem ipsum"]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

AttachmentSize
Image icon missing-last-line.png419.14 KB
v6.7
jasper library
T3O's picture
T3O
2
Joined: Aug 14 2019 - 6:34am
Last seen: 1 month 1 week ago
Feedback
randomness