sugita Posted May 28, 2009 Share Posted May 28, 2009 I am trying to use Style Library in my report.My requirement is that a perticular feild should have font color as RED if the condition is met else it should have font color as black.Can someone give me the steps to use style library?(iReport version used is 3.0.0)Thanks Link to comment Share on other sites More sharing options...
rameshinpower Posted May 28, 2009 Share Posted May 28, 2009 Hi Sugitha Try dis one in the text field expression $F{FieldName}.equals("YourValue"}) ? "<style forecolor='red'>"+ $F{FieldName}+"</style> " : "<style forecolor='black'>"+ $F{FieldName}+"</style> " Regards-Ramesh Link to comment Share on other sites More sharing options...
dnvsrikanth Posted May 28, 2009 Share Posted May 28, 2009 Hi Sugitha You can use conditional styles for that. Check the samples shipped with the JasperReports distibution. DNV Srikanth. Link to comment Share on other sites More sharing options...
sugita Posted May 28, 2009 Author Share Posted May 28, 2009 Thanks Ramesh and Srikanth,Srikanth,Can you please help me with the version no and the file location of the samples shipped with the JasperReports.I tried $F{FieldName}.equals("YourValue"}) ? "<style forecolor=\'red\'>"+ $F{FieldName}+"</style> " : "<style forecolor=\'black\'>"+ $F{FieldName}+"</style> " but not got the required result. Link to comment Share on other sites More sharing options...
svenn Posted May 28, 2009 Share Posted May 28, 2009 Make sure that "Is styled text" is checked on the font tab. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted May 29, 2009 Share Posted May 29, 2009 Hi Sugitha, Check the sample given in the folder <jasperreports-x.x.x>/demo/samples/styledtext This folder is available in all the versions of jasperreports distribution. DNV Srikanth. 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