ayparraguirre Posted June 3, 2020 Share Posted June 3, 2020 Hello everyone,I have in the database, in the color table, the RGB value for each color.In the color report, I need to show color data and a colored rectangle with the RGB found.How to dynamically change the background color of this rectangle, for each color shown?IReport 3.5.1 Link to comment Share on other sites More sharing options...
I am Leo Posted June 4, 2020 Share Posted June 4, 2020 Try using a Text field. Then modify the Markup to HTML. Finally, add HTML code to the TextField's textFieldExpression and STYLE="background: #your-color-code" to your HTML tag. Link to comment Share on other sites More sharing options...
ayparraguirre Posted June 5, 2020 Author Share Posted June 5, 2020 Thanks for the way, but I'm new to IReport and I don't know how to do it!How do I make this html tag in textFieldExpression?My field comes from the database as $F{HEXA}, for example ... '# 000080' Link to comment Share on other sites More sharing options...
Solution ayparraguirre Posted July 28, 2020 Author Solution Share Posted July 28, 2020 Thanks Leo, I managed to solve it this way:"<style backcolor='"+ $F{HEXA} +"'>"+ $F{HEXA} +"</style>" 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