Unlock Powerful Report Styling with HTML Expressions in Oracle APEX

Search for a command to run...

Oracle APEX already includes Font APEX as the default icon library for Universal Theme. In most cases, that is enough. But in one of my APEX apps, I needed a few icons that were not available there, s

Looking to give your Oracle APEX mobile app a modern, native feel? Here’s a quick hack: add a floating action button that stays anchored at the bottom corner just like in popular mobile apps. This sma

APEX 26.1 has been updated to the Universal Theme. While much of the attention in this release is on AI features, I think the UT improvements are just as important for developers like me who care abou

The apex_barcode package offers a PL/SQL API to generate various types of barcodes. You can output barcodes as SVG (Scalable Vector Graphics) values or as PNG file blobs, making it easy to embed them

Oracle APEX makes it easy to get data on screen fast, but often, the default tabular output isn’t enough. What if you want to highlight statuses, add icons, or display badges all without writing complex SQL or JavaScript? HTML Expressions: a powerful feature that lets you transform your reports with just a few lines of markup and template directives.
An HTML Expression in Oracle APEX allows you to control how a column’s data is displayed by wrapping it in custom HTML, referencing column values, and using conditional logic—all within the APEX UI. You’ll find the HTML Expression field in many components, including Interactive Reports, Classic Reports, Cards, and Lists.
Key Benefits:
Separation of concerns: Keep UI logic out of your SQL queries.
Security: Underlying column data is used for downloads and filtering, not your HTML markup.
Flexibility: Add icons, badges, tooltips, and more dynamically.
Step 1: Open Page Designer
Select your report region (Interactive or Classic Report).
Click the column you want to format.
Find the “HTML Expression” property.
Step 2: Reference Column Values
#COLUMN_NAME# to insert the value of any column in your SQL query.Example: This displays the employee name in bold, followed by their job.
<strong>#ENAME#</strong> – #JOB#
APEX’s Universal Theme supports powerful template directives for conditional logic and dynamic content.
Show different output based on column values.
<strong>#ENAME#</strong> –
{case JOB/}
{when PRESIDENT/}
<span style="color:red;">#JOB#</span>
{when MANAGER/}
<span style="color:blue;">#JOB#</span>
{otherwise/}
<span style="color:green;">#JOB#</span>
{endcase/}
Keep SQL clean: Avoid embedding HTML in your SQL queries. Use HTML Expressions for UI logic.
Hidden columns: If you need to generate complex HTML or values, create a hidden column in your query and reference it in the HTML Expression.
Security: The HTML Expression is only rendered in the browser. When users download the report, only the raw data is included, not your HTML, reducing the risk of leaking markup
Check out more examples here.