1
votes

I have an oracle apex classic report. I calculated sum of column credit,debit and balance using compute sum property of classic report. But I have to color the row which contains the sum of these columns(ie: the last row in classic report), to highlight the value. How can I color this row containing sum of columns?

1

1 Answers

2
votes

You can achieve this by creating a bespoke report template. Copy the current report template under a new name e.g. "My Report with Sum", and change the report to use the new template.

Now modify the template as follows:

  1. Copy the HTML under "Column Template 1" to "Column Template 2".

  2. Modify the HTML of "Column Template 1" by adding a special class to the td element to indicate that this row contains the sum e.g. class="sum-row".

  3. Add a condition to "Column Template 1" of type "Use based on PL/SQL expression" with an expression that will be true only for the sum row. Suppose you set up your report so that the column ENAME contains the text "Sum" on the sum row; in that case the condition would be :ENAME = 'Sum'
  4. Save the template changes.

Next, add some inline CSS to the page properties that sets the colours you want when the special class (e.g. sum-row) is present. You may need to be quite selective to override CSS settings already applied by APEX. For example (based on the APEX theme I happened to be in when I did this):

table.uReport>tbody>tr>td.sum-row {background-color: yellow}

You will probably need to experiment to get the CSS right for your case.