jasperbox Posted February 8, 2011 Share Posted February 8, 2011 I have the 2 text fields (field1 and field2) , and all I want is to put the logic that if field1 value is 'ADD', then the font of field2 value will be bold and italic. Now I hardcode the field2 value as bold and italic. I have no idea how to put this expression to put in this scenario: ( <condition> ? exp1 : exp2 ). Any ideas? Thanks so much!!! <textField isBlankWhenNull="true"> <reportElement x="91" y="0" width="28" height="15"/> <box> <pen lineWidth="0.25"/> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{field1}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement x="128" y="0" width="22" height="15"/> <box> <pen lineWidth="0.25"/> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textElement textAlignment="Center"> <font isBold="true" isItalic="true"/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{field2}]]></textFieldExpression> </textField> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now