Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to prevent the interpretation of HTML code in the header of a dynamic CR

Hello experts,
Im using APEX 21.2. In my project, I created a CR with dynamic header, i mean in Attributes tab > Heading section i selected PL/SQL Function Body as Type, by putting this code

DECLARE 
res VARCHAR2(255);

BEGIN
WITH res AS
  (SELECT d.deptno AS dept_no,
          LISTAGG(e.empno || ', ' || e.ename || '<br/>' ||  job || '<br/>' , ' + ') 
          WITHIN GROUP (ORDER BY d.deptno) AS emps
   FROM emp e
   INNER JOIN dept d ON e.deptno = d.deptno
   WHERE d.deptno = 10
   GROUP BY d.deptno)

SELECT ':' || LISTAGG(res.emps, ':') WITHIN GROUP (ORDER BY res.emps)
 INTO res 
FROM res ;

RETURN res;
END;

By running this code i get this result: (Im using custom report template)
image.pngTemplate Type: Generic Columns (column template)
And the code of Column Heading Template is:

<th #ALIGNEMENT# id="#COLUMN_HEADER_NAME#" class="custom-header" #COLUMN_WIDTH#>#COLUMN_HEADER#</th>

By reproducing the same code in apex.oracle.com, I get this result
image.pngI can't figure out where this difference comes from.
For more details i created a demo, on apex.oracle.com with this credentials:
Workspace: ws_initiation
Username: demo
Password: azerty1234
I used the Application 91527 - Custom CR / Page 2 - Custom Group Column, Region Example BR Header
Thank you for help.

Comments
Post Details
Added on Aug 1 2022
13 comments
211 views