Focal Point
when and stylesheet on defined field

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

August 18, 2004, 10:33 PM
<Vipul>
when and stylesheet on defined field
I am having problems using when in stylesheet to color the value in a column when it is defined field and I cannot use the real field in the when clause. please see the code attached and help me.


-* File testwhen.fex
DEFINE FILE CAR
DEALERCOST/P17.2CM = IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE 0;
END
-*
TABLE FILE CAR
SUM DEALER_COST
DEALERCOST
RETAIL_COST
BY MODEL
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
GRID=OFF,
$
TYPE=REPORT,
STYLE=NORMAL,
FONT='ARIAL',
SIZE=8,
BACKCOLOR='NONE',
$
TYPE=DATA,
SIZE=8,
BACKCOLOR=( RGB(255 255 255) RGB(230 230 230) ),
$
TYPE=REPORT,
COLUMN=N1,
WRAP=1.000000,
$
TYPE=REPORT,
COLUMN=N2,
JUSTIFY=LEFT,
WRAP=1.20000,
$
TYPE=DATA,
COLUMN=N2,
COLOR=RED, WHEN= DEALER_COST LE 5000 ,$
$
TYPE=DATA,
COLUMN=N3,
COLOR=RED, WHEN= DEALERCOST LE 5000 ,$
$
TYPE=TITLE,
BACKCOLOR=RGB(000 000 102),
COLOR=RGB(255 255 255),
$
-************************
TYPE=SUBHEAD, SIZE=8, $
ENDSTYLE
END
-RUN
-EXIT
I need the same behaviour on the dealercost field as with dealer_cost. I tried holding the first table request and then using the hold file - doesn't work.

Thanks in Advance,

Vipul

This message has been edited. Last edited by: <Mabel>,
August 18, 2004, 11:38 PM
<Vipul>
I have fixed this problem....I am posting this as this was so simple but totally threw me off. Yes I am a rookie.

Just so you donot make such silly stupid mistakes like I do all the time.

I just have to change the Defined field format from Packed to Decimal. The when condition will not work on packed fields

see: [url]
http://techsupport.informationbuilders.com/ibase/master...create16.htm#1258114
[/url]

Vipul :-)
August 19, 2004, 01:57 AM
<Pietro De Santis>
Vipul,

Don't be hard on yourself. I would say that the fact that WHEN styling won't work with a packed field is a deficiency of the software, not of the programmer!

Pietro.