Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamically changing row font color based on value
BirtUser2
Hello,
I have a table in which one column displays amounts in $. If an amount is over the `max single amount allowed` (determined by another field from the same dataSet,) I want that row`s font color to be red.
Secondly, I want to have a running total of the amounts listed and if an amount takes the running total over the `max total amount allowed` (also determined by another field from the same dataSet,) I want that amount to appear red.
I have tried editing the create script for the amount column but I do not know how to get the value of the row, compare it to another, and change the font color of that row based on a dynamic value.
Help appreciated!!
Find more posts tagged with
Comments
BirtUser2
I figured it out. First I created an aggregation that kept track of the running sum of the column "Amount." Then in the "Amount" Create script I put the following code:
if (row["Amount_Running_Sum"] > row["MaxTotalAmountAllowed"])
this.getStyle().color= "red";
if (row["Amount"] > row["MaxSingleAmountAllowed"])
this.getStyle().color= "red";
mwilliams
Glad you found a solution! For future issues you have, design questions like this are better asked in the <a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/forum/2-designing-birt-reports/'>designing
forum</a>. Let us know whenever you have questions!