Oracle Apex: Creating Link Column in Interactive Report

Oracle Apex: Creating Link Column in Interactive Report

In Oracle Apex, this is a general requirement to have a link in an interactive report for a particular column so that another page can be opened by passing some parameters to edit or view the records. You can create a link for a column in an interactive report in the following two ways:

  1. By specifying a column type as a link and then set the target page manually.
  2. In the interactive report query, you can create a virtual column for the link by specifying the Oracle Apex URL format for the page. For this type also, you need to specify the column as a link, but in the target, you can specify the column name as #MY_LINK#. The advantage of using this type is you can disable the link for specific rows based on a condition and can change the arguments too.

Create Link Column for Interactive Report in Oracle Apex

In this tutorial, you will learn how to create a link column for the interactive report in Oracle Apex using these two methods mentioned above.

Method 1:

Open your interactive report in Oracle Apex, then select the column in the report for which you want to define the link.

Then select the type as Link and specify the target and parameters by clicking on the No Link Defined button as shown in the below image:

Creating a link in interactive report in Oracle Apex.

Now save the changes and run the report to test. On click of the link, the page will open you specified in the settings.

But suppose if you want that link to get disable for particular rows, for example, where the column RESIGNED is equal to Y. Then follow the below approach:

Method 2:

The following is an example SQL query in which I am creating a Link column to open page 3 and specifying '#' if RESIGNED = 'Y' else specifying the URL:

select ROWID,
       EMPNO,
       ENAME,
       SAL,
       MGRNO,
       HIREDATE,
       DEPTNO,
       RESIGNED,
       case when nvl(resigned, 'N') = 'N' then
         'f?p=&APP_ID.:3:&SESSION.:::3:P3_EMPNO:'||EMPNO
       else
         '#'
       end LINK
  from EMP

The URL in the above SQL query, it will open the page number 3 which is employee form and it is passing the parameter employee number. Now follow these steps to define this column as a link in the interactive report:

Make this LINK column a hidden column.

Then select the column in the report, for example, EMPNO, and change its type to Link. Then for the target set the URL as #LINK# as shown in the below image:

Adding link to report column in Oracle Apex.

This Post Has 2 Comments

  1. Mohan

    Hi,
    If I try to download this report as CSV or Excel, it will download the '#' or the 'f?p=&APP_ID.:3:&SESSION.:::3:P3_EMPNO:'||EMPNO

    How to solve this issue?
    Thank You,
    Mohan

  2. Itzik B

    Hi, How can make the link open a new tab by default?

Comments are closed.