Oracle sqlplus HTML报告 - 基于一列更改行颜色值

时间:2018-04-22 07:02:22

标签: oracle oracle11g html-table

我正在使用Oracle sqlplus MARKUP HTML将查询输出转换为HTML报告。

有没有办法根据一列值更改行(单元格)颜色? (不是单列单元格)

专栏:RAG 价值: 0 - (整行应该显示为白色)

1 - (整行应该是黄色的)

2 - (整行应该显示为RED)

3-(整行应该显示为绿色)

SET VERIFY OFF 
SET TRIMSPOOL ON 
SET TRIMOUT ON 
SET FEEDBACK OFF 
SET HEADING ON 
SET ECHO OFF 
SET PAGES 150 
SET TERMOUT OFF

--TTITLE center 'Support - Check List' SKIP 2

Column "Start Time"  Format A10  Heading "Start Time|(UTC)"
Column APPLI         Format A11  Heading  Application
Column CHECK_DSC     Format A100 Heading "Check Description"
Column CHK_TYPE      Format A10  Heading "Check Type"
Column COMPLETED_BY  Format A10  Heading  Completed|By
Column "Completed Time" Format A10 Heading "Completed|Time(UTC)"



set markup html on spool on entmap off -
 head '<title>Support - Check List</title> -
 <style type="text/css"> -   
 table { background: #FFFFE0; font-size: 99%; } -
    th { background-color: DarkBlue;    color: white} -
    td { padding: 0px; } -  
</style>' -
 body 'text=black bgcolor=FAFAD2 align=left' -
 table 'align=center width=99% border=3 bordercolor=black bgcolor=white'

SPOOL chk.html
-- @ABC.txt

SELECT T1.CHK_ID ,
  TO_CHAR(FLOOR(ST_TIME/60),'00')  ||':'  ||TO_CHAR(MOD(T1.ST_TIME,60),'00') "Start Time",
  APPLI ,
  CHECK_DSC ,
  CHK_TYPE,
  COMPLETED_BY ,
  CASE
    WHEN COMPL_TIME IS NOT NULL 
    THEN TO_CHAR(FLOOR(COMPL_TIME/60),'00')      ||':'      ||TO_CHAR(MOD(COMPL_TIME,60),'00')
  END "Completed Time",
  RAG -- 0,1,2,3
FROM CHK_LIST T1,
  CHK_LOG T2
WHERE T1.CHK_ID=T2.CHK_ID ;


SPOOL off;

0 个答案:

没有答案