KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Mechanism to highlight cells based on value in a table view #1448

Open cnetsystems opened this topic on on May 18 - 1 comments

cnetsystems commented on May 18

I am building some audit/compliance reports and am curious if there is a built in mechanism to highlight values out of spec. I think my ideal scenario would be something like this, where the return value is added to the css class for the cell that contains the value

 Table::create(array(
        ...
        "columns"=>array(
            "col_name"=>array(
                "label"=>"Cost",
                "filter"=>function($value) {
                    switch ($value) {
                        case ($value < $minimum_accepted_value):
                            return "red";
                        case (($value > $minimum_accepted_value) && ($value < $maximum_accepted_value)):
                            return "green";
                        case ($value > $maximum_accepted_value):
                            return "orange";
                        default: 
                            return;
                    }
                }
            )
        ),
        ...
    ));
KoolReport commented on May 20

You can define css class name for cell base on value. Here could be idea for you.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None