Introduction
Oracle APEX
provides built-in region titles for reports and Interactive Grids. However, in
enterprise applications developers often need more control over the appearance
of page headings, especially when displaying contextual information such as
employee names, vehicle numbers.
This article
demonstrates how to create a custom styled heading with dynamic page item
values above a report region while avoiding duplicate titles and unnecessary
spacing.
· One Interactive Grid region named Service Request Detail
· Basic familiarity with APEX Page Designer
Objective
Solution
Step 1: Create Interactive Report Region
a) Set the Report Region Title
In Page Designer, click your report region (e.g., Service
Request Details). Under Identification, set the Title field to
match your region name:
Location: Local Database
Type: SQL Query
SQL Query:
SELECT
ROW_NUMBER() OVER (ORDER BY
req.posted_date DESC) AS SNO,
req.req_id,
req.vehicle_id,
v.vehicle_no,
req.emp_id,
req.posted_date,
v.vehicle_type
FROM veh_servicerequest req,
veh_vehicle_setup v
WHERE req.vehicle_id
= v.vehicle_id
and req.bill_posted = 'Y'
Step 2: Create Page Item
·
Create page item: P398_VEHICLE_NO
·
Set type: Hidden
Figure : 3
Under Source
·
From Region Select
·
Type SQL Query (return
single value)
·
SQL Query
SELECT
vehicle_no || ' - ' || vehicle_desc
FROM (
SELECT v.vehicle_no,
v.vehicle_desc
FROM veh_servicerequest req,
veh_vehicle_setup v
WHERE req.vehicle_id =
v.vehicle_id
AND req.bill_posted = 'Y'
ORDER BY
req.posted_date DESC
)
WHERE ROWNUM = 1;
Step 3: Add a Static Content Region for the Heading
Add
a styled heading above your report region:
1 Right-click your page in the Page Designer tree → Create Region
Figure : 5
2 Under Identification, set the Title of this new Static Content region to: Service Request Details
Note: The Title
field is mandatory in APEX and cannot be left blank.
3 Set Type to Static Content
Figure : 6
4 Under Source → HTML Content, paste the following:
width: 100%;
display: flex;
align-items: center;
background: #98AFC7;
padding: 4px 25px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
">
font-family: 'Roboto', 'Segoe UI', sans-serif;
font-size: 27px;
color: #f8f9fa;
font-weight: 500;
margin: 0;
letter-spacing: 0.8px;
">
Vehicle Service Request Details
: &P398_VEHICLE_NO.
</h2>
</div>
Note: &P398_VEHICLE_NO. is an Oracle APEX substitution string. At runtime, Oracle APEX replaces it with the value of the page item P398_VEHICLE_NO.
5 Set the region sequence so it appears just above your report region
Step 4: Hide the Built-in Title Using Template Options
To prevent the duplicate heading, hide the report region's
built-in title:
1.
Click your report region in Page Designer
2.
Go to Appearance → Template Options → Click the button
3.
Find the Header setting and select Hidden but accessible
4. Click OK and
Save the page
Step 5: Remove the Gap between Heading and Report
A spacing gap
often appears between the Static Content heading region and the report region
below it. To fix this:
- Run the page
in Oracle APEX
- Hover over
the Static Content heading region a
pencil (✏️) icon will
appear in the top-right corner of the region
- Click the
pencil icon to open Quick Edit
- In the Quick
Edit panel, click Template Options
- Set Top
Margin to None
- Set Bottom Margin to None
- Click OK
- Save the
page and refresh to confirm the gap is removed
Step 6: Save
and Run
Save the page and run it to verify that the styled heading displays correctly with the Oracle APEX substitution value of the page item and without spacing gaps.
Conclusion
In this article using a Static Content
region together with dynamic page item provides a flexible way to create
professional report headings in Oracle APEX. This approach improves UI clarity and
gives developers full control over styling while remaining fully compatible
with the Universal Theme.









Comments
Post a Comment