davide83 Posted January 22, 2010 Share Posted January 22, 2010 hello,how can i change the background color of a report element depending on the value of a parameter or a variable?I try in this way.(See CODE)It doesn't work.answer pleaseeeeeeeeeeeeeeeeeeeeeee!!!!! /tools/fckeditor/editor/images/smiley/msn/cry_smile.gifCode: Link to comment Share on other sites More sharing options...
mrcaffeine Posted January 22, 2010 Share Posted January 22, 2010 You might want to use a conditional style instead. The style contains a name and for each condition and the corresponding color settings. The text itself gets the style applied. not sure if this will help for your requirement. Link to comment Share on other sites More sharing options...
davide83 Posted January 22, 2010 Author Share Posted January 22, 2010 Thanks!pheraps I was not much precise.I need to set the back color of a report element run time. The problem is that I don't know which the colors could be neither how many. Link to comment Share on other sites More sharing options...
davide83 Posted January 25, 2010 Author Share Posted January 25, 2010 I'll try to be more precise and simple:I've got a database table with a list of exadecimal colors and I want this colors to be tha backcolor of different reportelement. I'd like to make something like: backcolor=""+$F{color}+""in the JRXML code in the list of report element property.Help me please!Post Edited by davide83 at 01/25/2010 11:12 Link to comment Share on other sites More sharing options...
lucianc Posted January 29, 2010 Share Posted January 29, 2010 JR doesn't support such dynamic element properties. But you can use styled text to do this, see the demo/samples/styledtext sample report to get an idea on how it works.Regards,Lucian Link to comment Share on other sites More sharing options...
davide83 Posted February 4, 2010 Author Share Posted February 4, 2010 Thanks lucian.your answer had been very precise. I already try with styled text and i get a good result but it wasn't what I wanted. hello Link to comment Share on other sites More sharing options...
damiankober Posted September 22, 2010 Share Posted September 22, 2010 As it has been said here, the styled text background color applies only to the text and not the texfieldIs there way of coloring the whole textfield without the need of creating a conditional style for each one of the possible colors?like the styled text does but for the whole textfield Link to comment Share on other sites More sharing options...
damiankober Posted September 22, 2010 Share Posted September 22, 2010 there is a scriplet approach Teodor posted herehttp://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=73973 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