Focal Point
Font Color

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1201081471

June 29, 2006, 12:49 PM
KellyT
Font Color
Hello,

How do I go about changing font color while doing and if statement. I have certain information that I want red and other information purple and then the rest black. I would like to do an if statement. If lateFlag = 'L' then color = 'purple'.

Thanks for the help in advance.


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
June 29, 2006, 01:06 PM
Pam Kratt
I do this through the stylesheet. Have the default set as black and then add the following:

TYPE=DATA, COLOR=Purple, COLUMN=DIFF, WHEN=lateFlag eq 'L', $
TYPE=DATA, COLOR=Red, COLUMN=DIFF, WHEN=lateFlag eq 'X', $


webfocus 8.105M; os: windows; pdf, html, exl2k, csv
June 29, 2006, 01:10 PM
KevinG
Kelly,

Check out the conditional styling options available in the STYLESHEET. You can easily do this in the stylesheet using a conditional test (slightly different syntax than in the body of the report) and assign RGB colors to the lines.

Kevin


WF 7.6.10 / WIN-AIX
June 29, 2006, 02:04 PM
susannah
Kelly, check out the article on Focal Point's Focus on Developers called "What color is Indian Red, anyway?"




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
July 12, 2006, 01:21 PM
KellyT
Pam,

Here is the code that I used and it still doesn't work. I'm not getting an errors it just isn't turning the font to the different color.

Thanks for your help,
Kelly

ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='SCREEN',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=DATA,
COLOR='PURPLE',
COLUMN=DIFF,
WHEN=lateFlag eq 'L',
$
TYPE=DATA,
COLOR='RED',
COLUMN=DIFF,
WHEN=lateFlag eq 'P',
$


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
July 12, 2006, 01:33 PM
Pam Kratt
try removing the quotes around the color. Let me know if that works.


webfocus 8.105M; os: windows; pdf, html, exl2k, csv
July 12, 2006, 01:34 PM
KevinG
Kelly,

Where you have COLUMN=DIFF, replace DIFF with the name of your column.

Kevin


WF 7.6.10 / WIN-AIX
July 12, 2006, 01:36 PM
KellyT
Pam that still didn't work. I had it working a while ago with the code you gave me but I ended up change stuff in the overall report and now I can't get it to work again.

Thanks


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
July 12, 2006, 01:41 PM
Jim_at_LM
We ref. the column:

WHEN = N1 EQ 1 ,


WebFOCUS 7.6.11, WINDOWS, HTML, PDF, EXCEL
July 12, 2006, 01:45 PM
KellyT
Thanks everyone for your help but I still can't get it to work. Here is the code I have in there now.

TYPE=DATA,
COLUMN=N22,
COLOR='PURPLE',
WHEN=N22 EQ 'L',
$
TYPE=DATA,
COLUMN=N22,
COLOR='RED',
WHEN=N22 EQ 'P',
$


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
July 12, 2006, 01:57 PM
KellyT
I got it.

Thanks everyone for your help. This is what I used:

TYPE=DATA,
COLOR='RED',
WHEN=N22 EQ 'P',
$
TYPE=DATA,
COLOR='PURPLE',
WHEN=N22 EQ 'L',
$


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
July 12, 2006, 02:03 PM
Glenda
Run this code and see if it works for you.

DEFINE FILE CAR
PROFIT/D12.2 = RETAIL_COST - DEALER_COST;
END
-*
SET BYDISPLAY = ON
-*
TABLE FILE CAR
PRINT
DEALER_COST
RETAIL_COST
PROFIT
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='SCREEN',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=DATA,
COLOR='PURPLE',
COLUMN=PROFIT,
WHEN=PROFIT GE 5000,
$
TYPE=DATA,
COLOR='RED',
COLUMN=PROFIT,
WHEN=PROFIT LE 999,
$
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END


Glenda

In FOCUS Since 1990
Production 8.2 Windows