0

我在交互式报告中使用了下面的查询并关闭了转义特殊字符。这只是为文本着色,而要求是突出显示整行。

有什么建议么?

前任:

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",
        case when "P_IT_ISSUES"."STATUS" ='Open' 
        then '<aaab style= "    color: green; " >'
        ||"P_IT_ISSUES"."STATUS"||'</aaab>'
        when  "P_IT_ISSUES"."STATUS" ='On-Hold' 
        then '<aaab style= "    color: red; " >'
        ||"P_IT_ISSUES"."STATUS"||'</aaab>' 
        else '<aaab style= "    color: red; " >'
        ||"P_IT_ISSUES"."STATUS"||'</aaab>' 
        end "Status"
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"
4

1 回答 1

0

我需要对这篇文章进行修订版 http://www.grassroots-oracle.com/2013/06/highlight-cell-background-in-apex-report.html

要突出显示整个单元格/行,您需要将条件类应用于您的列,类似于您现在所做的 - 但可能是一个简单的值。

首先,在查询中添加一个隐藏列。

case when status = 'X' then 'foo' else 'bar' end my_class

您可以将其添加为可见列的 HTML 表达式,例如:状态列。

<span class="#MY_CLASS#">#STATUS#</span>

然后使用 JS 进行刷新后动态操作,确保选中“初始化时触发”。此 JS 查找具有该类的任何元素,然后爬上 DOM 以找到相关的单元格/行,并将颜色应用于该行。

$("#my_report_static_id .foo").each(function(){
 $(this).closest('tr').css({"background-color":"red"});
});

如有必要,您可以使用类似的技术参数化该颜色。

于 2020-04-30T07:43:07.857 回答