Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Cell coloring in crosstab
dstoian
I am using BIRT Pro.
I am trying to color a cell in a crosstab, but I don?t know how to pick up the data from my cube (in order to use it in a script).
In a (normal) table I was able to make it work by putting this in the ?onCreate? event of the cell:
this.getStyle().backgroundColor = "#" + this.getRowData().getColumnValue("CompIdxColor").toString();
this.getStyle().color = "#" + this.getRowData().getColumnValue("CompTxtColor").toString();
Needless to mention probably, but if it's not obvious already, these color fields are calculated, and I already have them in my dataset / datacube, represented as a string of the 6 hex digits (i.e.: C0C0C0).
Is there a way to accomplish the same effect in a crosstab cell?
Thanks in advance.
Find more posts tagged with
Comments
mwilliams
Hi dstoian,
I'm using BIRT 2.3. In the script on a crosstab in 2.3, I believe you can use the following to get the data from and set the background color of a crosstab cell. This would be in the onCreate function of the crosstab script.
cellInst.getDataValue("CrosstabFieldMapping");
cellInst.getStyle().setBackgroundColor("#8800FF");
This might help you get what you're looking for. Hope it helps.
excited
Enclosed is an example demonstrated in the BIRT 2.3 webinar showing how to script different colors of the crosstab based on the values.