Jump to content
Fivewin Brasil

Destacar a cor de um texto-FastReport.


kapiaba

Recommended Posts

Bom dia!!!

No Fast Report quando tenho que destacar a cor de um texto utilizo 
o Editor de Realce onde, por exemplo, na aba Destaque coloco a Condição, 
CampoX < 1000 e seleciono a cor da Fonte desejada.

Mas no caso de eu ter 3 situações, por exemplo,
Se CampoX for maior que CampoY use a cor Azul
Se CampoX for menor que CampoY use a cor Vermelho
Se campoX for igual ao CampoY use a cor Preto

Tens uma dica de como proceder ?


Toya.

Link to comment
Share on other sites

Mui grato a todos os colegas....

...

Consegui resolver de uma maneira simples e lusitana:

Na montagem da tabela com os dados para impressão criei 6 campos
(CORCOL01, CORCOL02, CORCOL03, CORCOL04, CORCOL05, CORCOL06), onde
1=cor azul ($FF0000), 2=cor vermelha ($0000FF) e 3=cor preta ($000000).

Na aba "Código->Linguagem: PascalScript:
 

begin
    if (<DBFFR3."CORCOL01"> = 1) then LinhaDetalhe072.Font.Color := $FF0000;  
    if (<DBFFR3."CORCOL01"> = 2) then LinhaDetalhe072.Font.Color := $0000FF;  
    if (<DBFFR3."CORCOL01"> = 3) then LinhaDetalhe072.Font.Color := $000000;           

    if (<DBFFR3."CORCOL02"> = 3) then LinhaDetalhe082.Font.Color := $000000;           
    if (<DBFFR3."CORCOL02"> = 2) then LinhaDetalhe082.Font.Color := $0000FF;  
    if (<DBFFR3."CORCOL02"> = 1) then LinhaDetalhe082.Font.Color := $FF0000;

    if (<DBFFR3."CORCOL03"> = 1) then LinhaDetalhe092.Font.Color := $FF0000;  
    if (<DBFFR3."CORCOL03"> = 2) then LinhaDetalhe092.Font.Color := $0000FF;  
    if (<DBFFR3."CORCOL03"> = 3) then LinhaDetalhe092.Font.Color := $000000;           

    if (<DBFFR3."CORCOL04"> = 1) then LinhaDetalhe102.Font.Color := $FF0000;  
    if (<DBFFR3."CORCOL04"> = 2) then LinhaDetalhe102.Font.Color := $0000FF;  
    if (<DBFFR3."CORCOL04"> = 3) then LinhaDetalhe102.Font.Color := $000000;           

    if (<DBFFR3."CORCOL05"> = 1) then LinhaDetalhe112.Font.Color := $FF0000;  
    if (<DBFFR3."CORCOL05"> = 2) then LinhaDetalhe112.Font.Color := $0000FF;  
    if (<DBFFR3."CORCOL05"> = 3) then LinhaDetalhe112.Font.Color := $000000;           

    if (<DBFFR3."CORCOL06"> = 1) then LinhaDetalhe122.Font.Color := $FF0000;  
    if (<DBFFR3."CORCOL06"> = 2) then LinhaDetalhe122.Font.Color := $0000FF;  
    if (<DBFFR3."CORCOL06"> = 3) then LinhaDetalhe122.Font.Color := $000000;           
end.

 

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...