<style name="blueStyle" >
<conditionalStyle>
<conditionExpression><![CDATA[($P{INDIRIZZO}).length()>30 ? Boolean.TRUE : Boolean.FALSE]]></conditionExpression>
<style style="blueStyle" fontSize="3"/>
</conditionalStyle>
</style>
<parameter name="INDIRIZZO" class="java.lang.String"/>
[...]
<textField>
<reportElement x="178" y="94" width="157" height="17"/>
<textElement>
<font fontName="Arial" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{INDIRIZZO}]]></textFieldExpression>
</textField>
I want to downsize the font when INDIRIZZO length is > 30…
But this didn’t work….
You forgot to apply your custom style to the textField.
The correct snippet will be:
My working sample:
Another working sample with fontSize modifying: