jaw
jaw

Reputation: 319

change row background color based on column value in classic report in oracle apex

Is there a way to programmatically set the background color of a row based on data on column (exp . mgr =100 the row color green other that blue ....ex ). Is there a method (javascript?) by which this can be achieved? Regards

Upvotes: 1

Views: 6675

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132580

You can do this with a combination of page inline CSS and "execute when page loads" Javascript like this:

Page inline CSS

#myreport td {background-color: #aaccff}

"Execute when page loads" Javascript

$('#myreport td[headers="MGR"]').filter(function(){
    return $(this).text() === '100'
}).parent().children().css('background-color', '#aaffaa');

Here myreport is the static ID you assigned to the report region.


Another way without Javascript would be to build a bespoke report template with conditional column templates where one has the PL/SQL condition:

'#MGR#' = '100'

Upvotes: 5

Related Questions