简体   繁体   English

在Oracle Apex中更改列颜色

[英]Change column color in Oracle apex

How can I change the background color of every second column using interactive report. 如何使用交互式报告更改每隔两列的背景颜色。

我有4列。第二栏必须为蓝色,第四栏必须为红色

First of all I recommend using css. 首先,我建议使用CSS。 If you don't like CSS just go directly to IR section in my answer 如果您不喜欢CSS,请直接进入我的答案中的IR部分

CSS 的CSS

th:nth-child(even),
td:nth-child(even){
  background-color: red !important
}

or 要么

th:nth-child(2),
td:nth-child(2) {
  background-color: red !important
}

th:nth-child(4),    
td:nth-child(4) {
  background-color: blue !important
}

or 要么

th#C152380905075548116,
td[headers="C152380905075548116"] {
  background-color: red !important;
}

th#C152381026269548117,    
td[headers="C152381026269548117"] {
  background-color: blue !important;
}

where C152380905075548116 and C152381026269548117 are columns id that should be replaced. 其中C152380905075548116C152381026269548117是应替换的列ID。

IR 红外

If you really need to use native IR functionalities you should follow 3 steps: 如果您确实需要使用本机IR功能,则应遵循3个步骤:

  1. Change report SQL query so the column contains name of the color you want to use as background 更改报表SQL查询,以便该列包含要用作背景的颜色的名称

eg: 例如:

select
  ...
  VALUE1||'<span style="display: none">red</red>' as Artikl
  VALUE2||'<span style="display: none">blue</red>' as "Broj gresaka"
  ..
from
  ..
  1. Add IR highlights Actions > Format > Highlight 添加IR高亮Actions > Format > Highlight

Name = Red background (Artikl) 名称=红色背景(Artikl)

Sequence = Sequence 顺序=顺序

Enabled = Yes 启用=是

Highlight Type = Cell 高光类型=单元格

Background Color = #FF7755 背景颜色=#FF7755

Text Color = null 文字颜色=空

Column = Artikl 列= Artikl

Operator = Contains 运算符=包含

Expression = red 表情=红色

and

Name = Blue background (Broj gresaka) 名称=蓝色背景(Broj gresaka)

Sequence = Sequence 顺序=顺序

Enabled = Yes 启用=是

Highlight Type = Cell 高光类型=单元格

Background Color = #99CCFF 背景颜色=#99CCFF

Text Color = null 文字颜色=空

Column = Artikl 列= Artikl

Operator = Contains 运算符=包含

Expression = blue 表情=蓝色

  1. Set columns attribute Security > Escape special characters to No 将列属性“ Security > Escape special characters为“ No

It is not the perfect solution but it works :-) 这不是完美的解决方案,但它可以工作:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM