Skip to Main Content
Feature Request FR-3204
Product Area User Interface
Status CLOSED

3 Voters

Options in Application Definitions to show negative numbers with red color

jorge.cribb Public
· Jun 15 2023

Idea Summary
Options in Application Definitions to show negative numbers with red color or something like that

Use Case
In reports and interactive grid we need to show negative numbers in red color

Preferred Solution (Optional)
Add an option at Application level to show numbers with red color and an option at page level to override it.

This idea has been closed due to the lack of community activity during the period since it was submitted.

Comments

Comments

  • dalia.vazquez APEX Team OP 1.6 years ago

    Hi @jorge.cribb , that's a pretty interesting use!
    Currently it is possible to do it with sql and css.
    When performing a query you only verify if the data is positive or negative with case when, and add the class, tag or attribute you want, in the example I used a class.

    select 
       case when num >= 0 
          then '<span class="positive">'|| num ||'</span>' 
          else '<span class="negative">'|| num ||'</span>' end test
     from my_table
    

    Then you place the column in html expression and enter the name of your column.

    Afterwards you only place in CSS either inline on the page or in theme roller.

    I hope this helps! let me know if it worked for you

  • jorge.cribb OP 1.6 years ago

    I know it's posible doing this by using CSS, but I think will be better using check/uncheck an item's property because it will be according with the theme applied

  • swarnaprava.mishra OP 10 months ago

    Hi @jorge.cribb,

    I am looking for something similar.

    Instead of writing it in SQL, to have a class with color properties and applying it using Javascript dynamically. Please let me know if you find a solution.

    Thank you,

    Swarna.

  • jorge.cribb OP 10 months ago

    @swarnaprava.mishra My solution:

    At page level: A CSS class that evaluate if DATA-VALUE has a minus sign

    At  column level of an interactive report: Add “amount” class to the column and set DATA-VALUE with the value of the column that must be colored in case is it negative

    In the example: 

    <span class="amount" data-value="#AMOUNT_VALUE#">#AMOUNT_VALUE#</span>
    

    The result will be