chandu_517 Posted March 30, 2010 Share Posted March 30, 2010 Hi all,I'm new to ireports. I require the font style for data to be displayed dynamically based on some condition which is explained below.I have three Fields x,y,z to compare. if x < y or x>z then the data color for x should be changed to 'red' else data color of x should be in black color.please advice me as to how to proceed on this & where to validate.This requriement is for a swing window application.Thanks in advanceRegards, Chandu Link to comment Share on other sites More sharing options...
thangalin Posted March 30, 2010 Share Posted March 30, 2010 Add a conditional Style. Or use Print When Expression. Post Edited by thangalin at 03/30/2010 16:44 Link to comment Share on other sites More sharing options...
chandu_517 Posted March 31, 2010 Author Share Posted March 31, 2010 Hi,Can you expand your explanation using some code snippet also where to do it.Regards,Chandu Link to comment Share on other sites More sharing options...
ckampshoff Posted March 31, 2010 Share Posted March 31, 2010 Hi Chandu,which version of iReport do you use? In version 3.6.0 you'll find the Styles in the Report Inspector. There you have to add a Style (the way the field normally should look like) by right clicking on the word "Styles". After that you can add a conditional style.HTHChristina. Link to comment Share on other sites More sharing options...
slow Posted April 2, 2010 Share Posted April 2, 2010 Hi Christina,have you information about parametric styles?with "parametric" I mean styles that accept parameter for background colors, font dimension etc...i.e.: <conditionalStyle> <conditionExpression><![CDATA[new Boolean ($F{COL4}.matches("ddd"))]]></conditionExpression> <style name="AlternativeStyle" isDefault="false" backcolor="$P{aColor}" fontSize="$P{aValue}" /> </conditionalStyle> so, aColor, aValue can be read from a DB or passed to the report dinamically...thanks... 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