cristinab Posted November 9, 2006 Share Posted November 9, 2006 Hi,It is possible to set the parent element style using the style of the child element?I have a crosstab cell and I want to set its style dynamicaly using the style tag in the TextElement that is inside the crosstab cell(detail/detail). Regards,Cristina Link to comment Share on other sites More sharing options...
lucianc Posted November 9, 2006 Share Posted November 9, 2006 Why can't you directly set the cell style (JRXML: <cellContents style="StyleName">)? Setting the cell style by using the style of an element inside the cell is not supported, and makes no sense in my opinion. HTH,Lucian Link to comment Share on other sites More sharing options...
cristinab Posted November 9, 2006 Author Share Posted November 9, 2006 What I am trying to do is to set the style of the cell (backcolor)depending on the value of the textField element .I can't use conditional styles because I do not know how many colors I have to display This is why I thought I could change somehow the cell style using the <style> tag.I tried <style backcolor="red"> $F{displayValue}</style> as textExpression but the color is not apllied to the entire element :(. Regards,Cristina Link to comment Share on other sites More sharing options...
lucianc Posted November 9, 2006 Share Posted November 9, 2006 This kind of dynamic styling is not currently supported by JR. Regards,Lucian Link to comment Share on other sites More sharing options...
C-Box Posted November 10, 2006 Share Posted November 10, 2006 look here... perhaps it helps you a bit: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&catid=9&id=17772#17772 hthC-Box Link to comment Share on other sites More sharing options...
jodiey Posted November 18, 2006 Share Posted November 18, 2006 This sort of works for me, but what happens is if a cell is null, it does not highlight.Basically my report looks like this date part1 part2 part311/16/06 1 1 311/17/06 2 1 211/18/06 1 I am passing in a boolean of true if the date is a weekend and if so fill the background color to yellow (I want to highlight the row), so the 11/18 date would be highlighted. It will only fill in the cell of part2 because it has data, part1 and part3 stay white. Is there a way to solve this? Also, I tried to put a rectangle into the date header (so that 11/18/06 would be highlighted) but it overlaps the actual date, I can't send element to back. Any ideas? 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