I am developing a report with one Detail Band and one field that uses conditional styles. I am using Courier. The spacing between the lines is too large.
How can I minimize the space between the lines so the lines are nearly touching?
Below is the report XML.
<style name="DataHeaderTypeStyle">
<conditionalStyle>
<conditionExpression><![CDATA[$F{lineSectionType}==1]]></conditionExpression>
<style fontName="Courier New" fontSize="11"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$F{lineSectionType}==2]]></conditionExpression>
<style fontName="Courier New" fontSize="7"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[]]>
</queryString>
<field name="lineSectionData" class="java.lang.String">
<fieldDescription><![CDATA[lineSectionData]]></fieldDescription>
</field>
<field name="lineSectionType" class="java.lang.Integer">
<fieldDescription><![CDATA[lineSectionType]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="14" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement style="DataHeaderTypeStyle" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="1" width="555" height="13">
<printWhenExpression><![CDATA[$F{lineSectionType}==1 || $F{lineSectionType}==2]]></printWhenExpression>
</reportElement>
<textElement>
<font fontName="Courier New" pdfFontName="Courier"/>
<paragraph lineSpacing="Fixed"/>
</textElement>
<textFieldExpression><![CDATA[$F{lineSectionData}]]></textFieldExpression>
</textField>
</band>
</detail>
Set Jaspersoft Studio properties for "Text field" or "Static text" as follows:
Proportional
0.4
(or similar)The XML source should resemble:
<textElement>
<font fontName="Courier"/>
<paragraph lineSpacing="Proportional" lineSpacingSize="0.4"/>
</textElement>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With