sar12089
sar12089

Reputation: 65

How to highlight specific column value text in APEX Interactive Report

From Oracle DB, I'm fetching records and displaying it in Interactive report. In that I want to highlight specific text.

For example, "Here is the Mango" is the value retrieved from DB, I want to highlight the text "Mango" alone. I dont want to highlight the whole text.

The column value "Here is the " is same for all records. Only the next part needs to be highlighted/Formatted

Upvotes: 2

Views: 8911

Answers (2)

kapiell
kapiell

Reputation: 697

HTML Expression is good approach in your case since "Here is the " text is same for all records and you want to highlight remaining part.

Enter this in your column formatting,

Here is the #COLUMN_NAME#

Screenshot

enter image description here

Upvotes: 2

Hawk
Hawk

Reputation: 5170

One way to do it, is by doing conditional styling in your report. Below is emp table, where when the job title is president, the text is highlighted in bold.

enter image description here

I achieved this as follows:

  1. Add condition html to your query:

    select EMPNO,
         ENAME,
         CASE WHEN UPPER(JOB) = 'PRESIDENT' THEN '<span>This is a <b>'||JOB||'</b></span>' ELSE JOB END JOB,
         MGR,
         HIREDATE,
         SAL,
         COMM,
         DEPTNO
    from EMP
    
  2. If you are on APEX 5.1, then keep the column type as Plain Text, and set the option Escape special characters to NO. If you are on previous edition, specifically using the component view, then you can set the column type to Standard Report Column

Upvotes: 2

Related Questions