Oracle Apex交互式报表整行高亮实现方案咨询
Got it, let's fix that whole-row highlighting issue for your Oracle APEX interactive report. The approach you're using right now only styles the Status column text, but we can adjust this to color the entire row based on the status value. Here are two reliable methods, starting with the most maintainable one:
Method 1: Use APEX's Built-in Conditional Formatting (Recommended)
This is the official, low-maintenance way—no need to mess with your SQL or write custom CSS directly in queries.
- Open your interactive report's edit page.
- Click the Actions menu (top-right of the report) → Format → Conditional Formatting.
- Hit Add Format Rule to create a rule for each status:
- For "Open" status:
- Rule Name:
Open Issues - Green Row - Format Type: Select Row (this is the key difference from your current column-only formatting)
- Condition: Choose Column Value, pick the
Statuscolumn, set operator to=, and value toOpen - Style: Click CSS and paste your desired row styling, e.g.,
background-color: #d4edda; color: #155724;(light green background with dark green text)
- Rule Name:
- Repeat for "On-Hold" and other statuses:
- For "On-Hold", use something like
background-color: #f8d7da; color: #721c24;(light red background with dark red text)
- For "On-Hold", use something like
- For "Open" status:
- Save the rules, then refresh your report—you'll see entire rows highlighted based on status.
Method 2: SQL + Custom CSS (For Advanced Customization)
If you need more control and prefer working with SQL, you can generate CSS classes per row and apply them directly.
Step 1: Modify Your Query
Add a computed column to generate a unique CSS class for each status:
SELECT "P_IT_ISSUES"."ISSUE_SUMMARY" as "ISSUE_SUMMARY", decode("P_IT_PEOPLE_1"."PERSON_NAME",NULL,'Unassigned', "P_IT_PEOPLE_1"."PERSON_NAME") as "ASSIGNED_TO", "P_IT_ISSUES"."STATUS" as "Status", -- New column to define row CSS class CASE WHEN "P_IT_ISSUES"."STATUS" = 'Open' THEN 'row-open' WHEN "P_IT_ISSUES"."STATUS" = 'On-Hold' THEN 'row-on-hold' ELSE 'row-closed' END AS "ROW_CLASS" FROM "P_IT_PEOPLE" "P_IT_PEOPLE_1", "P_IT_DEPARTMENTS" "P_IT_DEPARTMENTS", "P_IT_PEOPLE" "P_IT_PEOPLE", "P_IT_ISSUES" "P_IT_ISSUES" WHERE "P_IT_ISSUES"."IDENTIFIED_BY_PERSON_ID"="P_IT_PEOPLE"."PERSON_ID" AND "P_IT_ISSUES"."ASSIGNED_TO_PERSON_ID"="P_IT_PEOPLE_1"."PERSON_ID"(+) AND "P_IT_ISSUES"."RELATED_DEPT_ID"="P_IT_DEPARTMENTS"."DEPT_ID"
Step 2: Attach the CSS Class to Rows
- Go back to your interactive report's edit page, switch to the Attributes tab.
- Scroll down to the Row Attributes section, and in the CSS Classes field, enter
&ROW_CLASS.(this references the new column we added).
Step 3: Add Custom CSS to Your Page
- Open your page's Page Properties → CSS → Inline.
- Paste in the styles for your row classes:
.row-open { background-color: #d4edda; color: #155724; } .row-on-hold { background-color: #f8d7da; color: #721c24; } .row-closed { background-color: #fff3cd; color: #856404; } /* Example for closed status */
Save everything, refresh your report, and you'll see entire rows styled based on their status.
内容的提问来源于stack exchange,提问作者Velocity

