Focal Point
[Solved]Styling rows from multiple HOLD files

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

February 01, 2018, 04:48 PM
srajeevan
[Solved]Styling rows from multiple HOLD files
Hi..
I have created a report where i want display the values of a row in green and red based on values.
the column format looks like below :

COUNTRY    ROWLABEL    Jan  Feb  March  
Country1   year  2016  10   50    100
           year  2017  5    80     80
	   variance   -xx  +yy    -zz
			
Country2   year  2016  10   50    100
           year  2017  5    80     80
	   variance   -xx  +yy    -zz
  


I have hold files for the value and the variance values.so basically it comes from same field.
I want to color red if it variance is -ve and green if positive.
I can color the whole variance row with
 TYPE=DATA,
     COLOR='GREEN',
     WHEN=ROWLABEL EQ 'variance',
   $
 

How can i style the column value for Variance alone?When ever i mention the column name in styling it will get affected to all column values as the three row values come from one field from different hold files joined using MORE command.

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


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
February 02, 2018, 01:36 AM
Chaudhary
Hi Srajeevan , Are you looking something like this ?

 TABLE FILE CAR
SUM 
     CAR.BODY.SALES
	 WIDTH
BY  CAR.COMP.CAR

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
TYPE=DATA, COLUMN = N2,
     COLOR='RED',
     WHEN=SALES LE 0,
   $
   TYPE=DATA, COLUMN = N2,
     COLOR='GREEN',
     WHEN=SALES GT 0,
   $
   TYPE=DATA, COLUMN = N3,
     COLOR='RED',
     WHEN=WIDTH LE 100,
   $
   TYPE=DATA, COLUMN = N3,
     COLOR='GREEN',
     WHEN=WIDTH GT 100,
   $
ENDSTYLE
END
 

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


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
February 02, 2018, 07:59 AM
MartinY
Hi srajeevan,
Your issue here is that you want to style a row/column data and it looks like it is also related to an ACROSS value (month).

In this case I suggest to define a MACRO where you can have combined conditions and also, the styling option will slightly differ for ACROSS columns.

Look at below sample
DEFINE FILE GGSALES
SALES_YY/YY=DATE;
SALES_MM/MONTH=DATE;
DOL/P9C = DOLLARS - BUDDOLLARS;
END
TABLE FILE GGSALES
SUM DOL AS ''
    COMPUTE VARNEG /A1 = IF SALES_YY EQ 1997 AND DOL LT 0 THEN 'Y' ELSE 'N'; NOPRINT
    COMPUTE VARPOS /A1 = IF SALES_YY EQ 1997 AND DOL GT 0 THEN 'Y' ELSE 'N'; NOPRINT
BY CITY
BY SALES_YY AS ''
ACROSS SALES_MM AS ''

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE SET LINES 999999
ON TABLE SET BYPANEL ON
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
     DEFMACRO=VAR_NEG,
     MACTYPE=RULE,
     WHEN=VARNEG EQ 'Y',
$
     DEFMACRO=VAR_POS,
     MACTYPE=RULE,
     WHEN=VARPOS EQ 'Y',
$
TYPE=DATA,
     ACROSSCOLUMN=DOL,
     COLOR=RED,
     MACRO=VAR_NEG,
$
TYPE=DATA,
     ACROSSCOLUMN=DOL,
     COLOR=GREEN,
     MACRO=VAR_POS,
$
ENDSTYLE
END
-RUN



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
February 05, 2018, 11:28 AM
srajeevan
Thanks.
I have created a define field where i checks the conditions and then used that field in style sheet.


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
February 05, 2018, 02:25 PM
MartinY
Please edit your first post then add [SOLVED] at the beginning of the subject


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