Focal Point
[SOLVED] Color Coding for Column Total

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

September 03, 2010, 07:54 AM
Shru
[SOLVED] Color Coding for Column Total
HI,

I have a report as the format mentioned below


Car Dept1 Dept2 Dept3 Dept4


Car1 1 5 7 8

Car2 3 6 1 2

Car3 2 1 3 4

Color 0 3 -1 0

Total 7 12 11 14


Here the total is the column total excluding the Color column and color is a calculated field. Based on the Color column I want the Total column to be color coded. Example if the color column value is 0 then the Backcolor for Total should be Green else if Color column value is -1 then the backcolor for Total should be yellow.So in the examle above the first cell of the Total column sgould be green the second red...

Any thoughts how this can be achieved


thanks

This message has been edited. Last edited by: Kerry,


769 Excel,PDF and HTML
September 04, 2010, 03:24 AM
Dan Satchell
Try this:

.
.
ON TABLE SET STYLE *
 TYPE=GRANDTOTAL, BACKCOLOR=GREEN,  WHEN=Color EQ 0, $
 TYPE=GRANDTOTAL, BACKCOLOR=RED,    WHEN=Color EQ 3, $
 TYPE=GRANDTOTAL, BACKCOLOR=YELLOW, WHEN=Color EQ -1, $
 etc.
ENDSTYLE
.
.



WebFOCUS 7.7.05
September 06, 2010, 06:43 AM
Shru
thanks Dan for replying, but for some strange reason this is not working. I forgot to mention in my prevoius post that Dept1 Dept2... is an across field. Is this the reason for the code not working. Is there a work around i need to do for the across field


769 Excel,PDF and HTML
September 06, 2010, 07:07 AM
Tony A
You say that Color is a calculated field so how are you achieving the layout that you imply? Are you using FML, it could make the difference in how you would attempt this.

Although generally with ACROSS value summarisation you would do something like -
ON TABLE SET STYLE *
 TYPE=GRANDTOTAL(*), BACKCOLOR=GREEN,  WHEN=Color EQ 0, $
 TYPE=GRANDTOTAL(*), BACKCOLOR=RED,    WHEN=Color EQ 3, $
 TYPE=GRANDTOTAL(*), BACKCOLOR=YELLOW, WHEN=Color EQ -1, $
 etc.
ENDSTYLE


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 06, 2010, 08:43 AM
Shru
hi Tony,

I am calculating the Color field separately and then doing a more with the rest of the report.

I tried your method also but i am still unable to achieve the required results.


769 Excel,PDF and HTML
September 07, 2010, 03:20 AM
Shru
Also i noticed that when i give the condition1 the report works fine. As soon as i give the condition 2 it takes by default condition 2

condition1
 TYPE= GRANDTOTAL,
BACKCOLOR='GREEN',
COLUMN=N2,
WHEN=E01 EQ 'ZCOLOR',
$

condition 2
TYPE= GRANDTOTAL,
-*MACRO=COND0002,
BACKCOLOR='RED',
COLUMN=N2,
WHEN=E01 EQ 'ZCOLOR',

$ 


I also want to know if i can give 2 when conditions for one column.

For example i want

  TYPE=GRANDTOTAL,
BACKCOLOR='GREEN',
COLUMN=N2,
WHEN = E01 EQ 'COLOR',
WHEN = E02 EQ 0
$



769 Excel,PDF and HTML
September 10, 2010, 04:30 PM
Kerry
Hi Shru,

I consulted with our internals and was suggested that it is better that you open a case with Customer Support Services for additional assistance. To open a case, you may either call at 1-800-736-6130, or access online at InfoResponse.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
September 12, 2010, 12:19 AM
Senthilvasan S
Shru,

Create a flag field in the define with the
DEFINE FILE
FLAG1/I2 = IF CODITION! OR CONDITION2 THEN 0 ELSE
-IF CONDITION1 OR CONDITION3 THEN 1 ELSE 2;
END

-----STULE ------

condition1

TYPE= GRANDTOTAL,
BACKCOLOR='GREEN',
COLUMN=N2,
WHEN=FLAG1 EQ 0,
$

condition 2
TYPE= GRANDTOTAL,
-*MACRO=COND0002,
BACKCOLOR='RED',
COLUMN=N2,
WHEN=FLAG1 EQ 1,
$

condition 3
TYPE= GRANDTOTAL,
-*MACRO=COND0002,
BACKCOLOR='BLUE',
COLUMN=N2,
WHEN=FLAG1 EQ 2,
$

-------STYLE -------


WebFOCUS 7 6 9
Windows XP
HTML, AHTML, PDF, EXCEL
September 13, 2010, 01:21 AM
Shru
Thanks everyone for the reply.

I used SET command to resolve the issue. I read all the data into a variable and then used

 -SET &COL1 = IF &VAR1 EQ 0 THEN 'BACKCOLOR=GREEN' ELSE IF &VAR1 LT 0 THEN 'BACKCOLOR=YELLOW' ELSE 'BACKCOLOR=RED; 


Then in the styling I used
 TYPE= SUBFOOT,OBJECT=FIELD,ITEM=1,COLSPAN=1,&COL1,$  



769 Excel,PDF and HTML