My solution shows a simple JRXML , which is the desired result regardless of the tools someone is using, for example. iReport GUI, dynamic reports or java code for developing Jasper reports.
First, define a style that corrects the indent by pulling the first line a few pixels to the left and pushing the entire rectangle equal width to the right:
<style name="hanging-indentation-style"> <box leftPadding="23"/> <paragraph firstLineIndent="-23"/> </style>
Secondly, this style applies to reportElement textField :
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="hanging-indentation-style" positionType="Float" mode="Transparent" x="0" y="0" width="555" height="20" isRemoveLineWhenBlank="true"/> <textElement markup="html"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{description}]]></textFieldExpression> </textField>
Depending on your font size, you can change the style values ββto suit your needs.
I adapted the input from Marker Alignment in Jasper reports that use dynamic api reports, and the Jasper Report HTML bullet hanging indent , where it is displayed through a graphical interface, which was impossible in my case using iReport Designer 4.5.1, because there is no way apply the add-on directly to textField .
source share