I am trying to style the ACROSS value based on a condition. Here is the sample code with CAR file.
TABLE FILE CAR
SUM SALES
COMPUTE COL1/I1 = IF COUNTRY EQ 'ENGLAND' THEN 1
ELSE IF COUNTRY EQ 'FRANCE' THEN 2
ELSE IF COUNTRY EQ 'ITALY' THEN 3
ELSE IF COUNTRY EQ 'JAPAN' THEN 4
ELSE IF COUNTRY EQ 'W GERMANY' THEN 5 ELSE 0;NOPRINT
BY CAR
ACROSS COUNTRY
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
-*INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,$
DEFMACRO=COND1, MACTYPE=RULE, WHEN=COL1 EQ 1, $
DEFMACRO=COND2, MACTYPE=RULE, WHEN=COL1 EQ 2, $
DEFMACRO=COND3, MACTYPE=RULE, WHEN=COL1 EQ 3, $
DEFMACRO=COND4, MACTYPE=RULE, WHEN=COL1 EQ 4, $
DEFMACRO=COND5, MACTYPE=RULE, WHEN=COL1 EQ 5, $
TYPE=ACROSSVALUE, ACROSS=COUNTRY, BACKCOLOR=RGB(150 54 52), MACRO=COND1, $
TYPE=DATA, ACROSS=COUNTRY, BACKCOLOR=RGB(150 54 52), MACRO=COND2, $
ENDSTYLE
END
I am trying to give different BACKCOLOR to the countries which is a ACROSS field.
I tried with TYPE as ACROSSVALUE and DATA since the different countries are value from the field COUNTRY.But no luck.
Appreciate if anyone can help me with this.This message has been edited. Last edited by: srajeevan,
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
April 29, 2019, 12:23 PM
MartinY
ACROSSTITLE is for the displayed ACROSS title column : in your case the Country
ACROSSVALUE is for the displayed ACROSS columns : in your case the COUNTRY field
You cannot style ACROSSVALUE using a MACRO since it's only one element. So, it can only have one color
ACROSSCOLUMN is the measure (PRINT/SUM) displayed in relation with the BY and ACROSS fields : in your case the SALES
TABLE FILE CAR
SUM SALES AS 'Sales'
COMPUTE COL1/I1 = IF COUNTRY EQ 'ENGLAND' THEN 1
ELSE IF COUNTRY EQ 'FRANCE' THEN 2
ELSE IF COUNTRY EQ 'ITALY' THEN 3
ELSE IF COUNTRY EQ 'JAPAN' THEN 4
ELSE IF COUNTRY EQ 'W GERMANY' THEN 5 ELSE 0; NOPRINT
BY CAR AS 'Car'
ACROSS COUNTRY AS 'Country'
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
-*INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,$
DEFMACRO=COND1, MACTYPE=RULE, WHEN=COL1 EQ 1, $
DEFMACRO=COND2, MACTYPE=RULE, WHEN=COL1 EQ 2, $
DEFMACRO=COND3, MACTYPE=RULE, WHEN=COL1 EQ 3, $
DEFMACRO=COND4, MACTYPE=RULE, WHEN=COL1 EQ 4, $
DEFMACRO=COND5, MACTYPE=RULE, WHEN=COL1 EQ 5, $
TYPE=DATA, ACROSSCOLUMN=SALES, BACKCOLOR=RGB(150 54 52), MACRO=COND1, $
TYPE=DATA, ACROSSCOLUMN=SALES, BACKCOLOR=BLUE, COLOR=WHITE, MACRO=COND2, $
ENDSTYLE
END
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
April 29, 2019, 12:43 PM
srajeevan
Thanks for pointing out differences. I am able to give color to the ACROSSCOLUMN.I am using the same way like your code. But i wanted to give color to different country names alone. Eg:The cell with the country name 'ENGLAND' in one color and FRANCE in another color.
That is what i am trying to accomplish.
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
April 29, 2019, 01:49 PM
MartinY
As I previously stated :
You cannot style ACROSSVALUE values (which is the country name) using a MACRO (or whatever else AFAIK) since it's only one element. So, it can only have one color.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
April 29, 2019, 03:29 PM
srajeevan
@MartinY ohk.I am little confused with the part "it's only one element".Because the ACROSS field has multiple DATA/values which are different.
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
April 29, 2019, 03:55 PM
MartinY
It's like even if the ACROSSVALUEs seems to be broke by their content (different country's name), it's only one thing which can be styled as a whole not according to individual values displayed. Each value (country name) cannot be referenced individually in a ACROSSVALUE as you wish AFAIK.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007