Search This Blog

Showing posts with label Manually add a link to a Classic Report. Show all posts
Showing posts with label Manually add a link to a Classic Report. Show all posts

Monday, June 30, 2025

How do I Manually add a link to a Classic Report

 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

A screenshot of a computer

AI-generated content may be incorrect.

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.

A screenshot of a computer

Description automatically generated

Step 4 – In the Classic report, navigate to the “Columns”, right click, and select “Add virtual column”.

A screenshot of a computer

AI-generated content may be incorrect.A screenshot of a computer

AI-generated content may be incorrect.

Step 4 – Make the following changes

A screenshot of a computer

Description automatically generated

Step 5 – Lets create the Form that will receive our data. Create a Form.

A screenshot of a computer

AI-generated content may be incorrect.


A screenshot of a computer

AI-generated content may be incorrect.


A screenshot of a computer

Description automatically generated

Select the primary Key

A screenshot of a computer

Description automatically generated

You should now have something like this

A screenshot of a computer

Description automatically generated

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.

A screenshot of a computer

AI-generated content may be incorrect.   A black box with red lines and white text

Description automatically generated


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.

A screenshot of a computer

AI-generated content may be incorrect.

Select the item that you want to pass “to” the Form page, in this  P41_Customer_ID

A screenshot of a computer

Description automatically generated

Next select the Value that you want to pass. In this case the CUSTOMER_ID column’s value (the table’s primary key)

A screenshot of a computer

Description automatically generated

A screenshot of a computer

AI-generated content may be incorrect.

It should now look like this.

A screenshot of a computer

Description automatically generated

Save the page and view in the browser.

We now have a page with a column but no actual link

A screenshot of a email

Description automatically generated

Step 8 –

In the link area, in the Link Text, enter a name, save, and review in browser.

A screenshot of a computer

AI-generated content may be incorrect.

Your page should now have a link that will navigate to the Form page

A screenshot of a email

AI-generated content may be incorrect.

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.

A screenshot of a computer

AI-generated content may be incorrect.

You now have a navigational icon for the link area

A screenshot of a email

AI-generated content may be incorrect.

Manually adding links to Classic Reports empowers developers to create dynamic and context-sensitive navigation paths that improve usability and workflow. With simple SQL modifications and careful configuration, you can integrate links that lead users to detailed views, edit forms, or any other relevant resources, making your Oracle APEX applications more intuitive and efficient.