jasperbox Posted February 4, 2011 Share Posted February 4, 2011 I tried to find the samples on how to put the condition logic in ireport. Here's my problem:I have the text fields field1 and field2, if the value of field1 is 'ADD', then I need to bold/italic the value of field2. Any ideas? Thanks in advance! <textField> <reportElement x="139" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{field1}]]></textFieldExpression> </textField> <textField> <reportElement x="320" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{field2}]]></textFieldExpression> </textField> Link to comment Share on other sites More sharing options...
szaharia Posted February 7, 2011 Share Posted February 7, 2011 You can solve it using conditional styles. See in the jasper sample how the 'OrderIdStyle' was defined. Try to set the condition expression as follows:<conditionExpression><![CDATA[boolean.valueOf("ADD".equals($F{field1}))]]></conditionExpression>and then apply it to the second text field.HTH,sandaPost Edited by shertage at 02/08/2011 07:52 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