Cor / Cores no Html

Citação de Kindrazki em 17 de novembro de 2014, 16:08Cor / Cores no Html
[code]
SCRIPT
sql
select
dia as DIA2
,fatvenda as FATVENDA2
,fatmeta as FATMETA2
,(fatvenda - fatmeta) as FATRESULTADO
,(Case when fatmeta > fatvenda then 'red' else 'blue' end) as COR
from
($v{sql_base}) t
order by
diaMENSAGEM DE NOTIFICAÇÃO:
<div id="content">
<table class="report">
<thead><tr><th>Dia</th><th>Fator Venda</th><th>Fator Meta</th><th>Resultado</th></tr></thead>
<tbody>
$> for (a = 1; a <= $c{DIA2:count}; a++) {
$> sb.append('<tr' + (a % 2 == 0 ? '$v{def-bgcolor2}>' : '$v{def-bgcolor1}>'));
<td>~~~</td><td>~~~~~~~~~~~</td><td>~~~~~~~~~~</td> -> $c{DIA2[a]} c; $c{FATVENDA2[a]} r; $c{FATMETA2[a]} r;
<td>
<div style="background-color: ~~~ ;text-align:right">~~~~~~~~~</div> -> $c{COR[a]}; $c{FATRESULTADO[a]} ;
</td>
</tr>
$> }[/code]
///////////////////// Outro modelo mudando cor da fonte também
[code]
Select
,'<div style="'||(Case when x.ncmxml <> x.ncmerp then 'background-color:red'||chr(59)||'color:white' else '' end)||'">'||x.ncmxml||'</div>' as CORNCMXML
,'<div style="background-color:'||(Case when x.ncmxml <> x.ncmerp then 'red' else '' end)||'">'||x.ncmerp||'</div>' as CORNCMERP
From
xNotificacao
@table -> Numero <br> Nota -> $c{NUMNOTA[a]} l;
Ncm <br> Xml -> $c{CORNCMXML[a]} l;
Ncm <br> Erp -> $c{CORNCMERP[a]} l;
@table[/code]
[code]
Outra forma bem simples é somar a cor junto ao campo.Select
'<font size="3" color="red">'||'VALOR'||'</font>' as campo
;[/code]
Cor / Cores no Html
[code]
SCRIPT
sql
select
dia as DIA2
,fatvenda as FATVENDA2
,fatmeta as FATMETA2
,(fatvenda - fatmeta) as FATRESULTADO
,(Case when fatmeta > fatvenda then 'red' else 'blue' end) as COR
from
($v{sql_base}) t
order by
dia
MENSAGEM DE NOTIFICAÇÃO:
<div id="content">
<table class="report">
<thead><tr><th>Dia</th><th>Fator Venda</th><th>Fator Meta</th><th>Resultado</th></tr></thead>
<tbody>
$> for (a = 1; a <= $c{DIA2:count}; a++) {
$> sb.append('<tr' + (a % 2 == 0 ? '$v{def-bgcolor2}>' : '$v{def-bgcolor1}>'));
<td>~~~</td><td>~~~~~~~~~~~</td><td>~~~~~~~~~~</td> -> $c{DIA2[a]} c; $c{FATVENDA2[a]} r; $c{FATMETA2[a]} r;
<td>
<div style="background-color: ~~~ ;text-align:right">~~~~~~~~~</div> -> $c{COR[a]}; $c{FATRESULTADO[a]} ;
</td>
</tr>
$> }
[/code]
///////////////////// Outro modelo mudando cor da fonte também
[code]
Select
,'<div style="'||(Case when x.ncmxml <> x.ncmerp then 'background-color:red'||chr(59)||'color:white' else '' end)||'">'||x.ncmxml||'</div>' as CORNCMXML
,'<div style="background-color:'||(Case when x.ncmxml <> x.ncmerp then 'red' else '' end)||'">'||x.ncmerp||'</div>' as CORNCMERP
From
x
Notificacao
@table -> Numero <br> Nota -> $c{NUMNOTA[a]} l;
Ncm <br> Xml -> $c{CORNCMXML[a]} l;
Ncm <br> Erp -> $c{CORNCMERP[a]} l;
@table
[/code]
[code]
Outra forma bem simples é somar a cor junto ao campo.
Select
'<font size="3" color="red">'||'VALOR'||'</font>' as campo
;
[/code]