Adding manual links to Classic Reports in Oracle APEX is a straightforward way to enhance navigation and interactivity within your applications. By embedding custom links directly into report columns, you can guide users to related pages, external websites, or perform specific actions, all from within the report. This approach offers flexibility and control over the user experience, allowing developers to tailor links precisely to the application’s requirements.
Manually adding a link to a Classic Report in Oracle APEX involves customizing the SQL query to include an HTML anchor tag, which creates clickable links within the report. This approach provides flexibility to direct users to other pages, external URLs, or even perform specific actions based on the data displayed.
To add a manual link, start by editing the SQL query used for the Classic Report. Identify the column where you want the link to appear or create a new column specifically for the link. Use the Oracle concatenation operator (||
) to build the HTML anchor (<a>
) tag, embedding the URL or page reference within it.
For example, if you want to add a link in a column called EMPLOYEE_ID that directs users to a detailed page for each employee, the SQL might look like this:
SELECT EMPLOYEE_ID,
FIRST_NAME,
LAST_NAME,
'<a href="f?p=&APP_ID.:10:&SESSION.:NO::P10_EMPLOYEE_ID:' || EMPLOYEE_ID || '">Details</a>' AS EMPLOYEE_LINK
FROM EMPLOYEES
In this example, the anchor tag links to page 10 in the current application, passing the EMPLOYEE_ID as a page item P10_EMPLOYEE_ID
. This link will appear in the EMPLOYEE_LINK
column as "Details". Users clicking this link will be navigated to the detail page for that specific employee.
After updating the SQL query, set the column attributes for the new link column inside the Classic Report settings. Change the column type to "Standard Report Column" and enable "Escape Special Characters" to NO. This ensures the HTML anchor tag renders correctly as a clickable link rather than showing raw HTML code.
You can also create links to external URLs by replacing the href
attribute value with the desired address. For dynamic URLs, concatenate the column values as needed to build the complete link.
This manual method allows full control over the link text, URL parameters, and appearance, enabling tailored navigation experiences within your Oracle APEX Classic Reports.
Additional tips:
-
Always disable escaping on the link column to render HTML.
-
Use
&APP_ID.
and&SESSION.
substitution strings for dynamic referencing within the application. -
Test links carefully to ensure proper navigation and parameter passing.
-
For better maintainability, consider using page-level items or application items for parameters.
By manually adding links, you enhance report interactivity and guide users through the application efficiently.
Example
Step 1 – We’re starting with an CUSTOMER table with 3 columns
Customer_ID
Full_Name
Email_Address
Step 2 – We are going to create a blank page with a custom report in it, added manually.
In this case is called: ClassicReport_ReportPage
Step 3 – Add region to the page and change it to a type of: Classic report Region. and wire it up to the Customer data table.
Step 4 – In the Classic report, navigate to the “Columns”, right click, and select “Add virtual column”.
Step 4 – Make the following changes
Step 5 – Lets create the Form that will receive our data. Create a Form.
Select the primary Key
You should now have something like this
Notice that in this case P41_CUSTOMER_ID is the key of the table
Step 6 – Go back to the Classic Report page. In this case it happens to be page 40 and our form page is page 41.
Navigate to the Link column and Edit the LINK area and click on the button.
Step 7 – Add the page number of the Form page (in this case is 41) and in the “Set Items” area, click on the hamburger list button.
Select the item that you want to pass “to” the Form page, in this P41_Customer_ID
Next select the Value that you want to pass. In this case the CUSTOMER_ID column’s value (the table’s primary key)
It should now look like this.
Save the page and view in the browser.
We now have a page with a column but no actual link
Step 8 –
In the link area, in the Link Text, enter a name, save, and review in browser.
Your page should now have a link that will navigate to the Form page
Step 9 – lets change to the words into a link. Select the hamburger next to the LinksText area and click on the fa-edit icon selection (or one of the other options) and save and review in browser.
You now have a navigational icon for the link area