Overview
Oracle Apex has different types of reports. All reports have their default function it’s an advantage. Suppose you want to achieve some different functionalities other than the default. We can use JavaScript, CSS, and HTML., etc.
Technologies and Tools Used
The following technology has been used to achieve the expected output.
- JavaScript
- HTML
- Oracle Apex
Use Case
In the Oracle Apex report, If you have to add any link column with the conditional display. then, we can use the HTML link column with the case statement. If we use the HTML link column, while downloading the report will have the HTML tag on it.
This document explains how to remove the HTML tag while downloading the report.
Architecture
Following steps explains in detail,
Step 1:
Create the interactive report in oracle apex page with below query.(Please change the query as per your requirement)
SELECT B.empno EMP_NUMBER,
CASE
WHEN (SELECT Count(*)
FROM emp a
WHERE a.empno = b.empno
AND Upper(created_by) = Upper(:APP_USER)) > 0 THEN
To_char(b.empno)
ELSE ‘<a href=”https://apex.oracle.com’
|| apex_util.Prepare_url (‘f?p=’
|| :APP_ID
||
‘:18:&SESSION.::&DEBUG.:18:P18_EMPNO:’
|| b.empno)
|| ‘” >’
|| b.empno
|| ‘</a>’
END EMPNO_HTML,
ename,
job,
mgr,
hiredate,
sal,
comm,
deptno,
created_by
FROM emp b
WHERE sal IS NOT NULL;
Step 2:
Set EMPNO_HTML column as hidden column and change escape special character to No.
Step 3:
In EMP_NUMBER column add below code in HTML expression.
#EMPNO_HTML#
Screen Shot
Output:
By using the above method, we can display the editable link option based on the condition.