Making Reports Navigable
An Interactive Report becomes truly useful when users can click a value to drill down to a detail page. Column links transform static data into an interactive navigation experience. APEX provides both declarative link columns and HTML-expression based approaches.
Declarative Column Link
Select a column in the IR attributes and set its Link properties. Target: Page in this application. Page: your detail page number. Set Items: P20_ORDER_ID = #ORDER_ID#. Link Text: #ORDER_ID# (or an icon). This creates a clickable link on every row that passes the primary key to the detail page.
Icon Links With Font APEX
-- Add an "Edit" icon link column
SELECT order_id,
'<a href="' || APEX_PAGE.GET_URL(
p_page => 20,
p_items => 'P20_ORDER_ID',
p_values => order_id
) || '" class="fa fa-pencil" title="Edit"></a>' AS edit_link,
customer_name, order_date, total
FROM orders;
Set the edit_link column’s “Escape special characters” to No so the HTML renders. Set the column heading to a single space and width to a small fixed value.
Multiple Action Links per Row
SELECT order_id, customer_name, total,
APEX_PAGE.GET_URL(p_page => 20, p_items => 'P20_ID', p_values => order_id) AS edit_url,
APEX_PAGE.GET_URL(p_page => 25, p_items => 'P25_ID', p_values => order_id) AS view_url
FROM orders;
-- Column HTML Expression for EDIT_URL:
<a href="#EDIT_URL#" class="t-Button t-Button--small">
<span class="fa fa-pencil"></span> Edit
</a>
-- Column HTML Expression for VIEW_URL:
<a href="#VIEW_URL#" class="t-Button t-Button--small t-Button--simple">
<span class="fa fa-eye"></span> View
</a>
Conditional Links
Show the edit link only for rows the user can modify. Use a CASE expression in SQL to output the link HTML only when conditions are met, and output empty string otherwise. This keeps the link logic in SQL where it is easy to maintain and test.
Opening in a Modal Dialog
To open the detail page in a modal dialog instead of navigating away, set the link target page’s “Page Mode” to “Modal Dialog.” APEX automatically opens it as a dialog when linked from a report. After the user closes the dialog, refresh the IR to reflect any changes made in the dialog using a Dynamic Action on the Dialog Closed event.