Focal Point
Style ACROSS columns.
May 15, 2008, 10:34 AM
Cyril JoyStyle ACROSS columns.
I have a report with ACROSS fields. I need the data in each across value to be colored. Means for example, all data under the ACROSS value ‘say 2’ has to be colored in RED. All data under the ACROSS value ‘3’ has to colored as ‘BLUE’ etc.
See the below code:
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
ACROSS SEATS
ACROSS CAR
ON TABLE SET STYLE *
TYPE=ACROSSVALUE,COLOR=RED, $
TYPE=ACROSS,COLUMN=C1,COLOR=GREEN, $
TYPE=DATA,ACROSSCOLUMN=RETAIL_COST,COLOR=BLUE,WHEN = SEATS EQ 2, $
END
Thanks for your help!
Regards,
Cyril Joy.
WF Production 8008 on Linux.
May 15, 2008, 11:15 AM
Francis MarianiCyril,
Though not elegant, this gets you on the way:
DEFINE FILE CAR
FLAG/D4 = SEATS;
END
TABLE FILE CAR
SUM
SALES AS ''
MIN.FLAG NOPRINT
BY COUNTRY
ACROSS SEATS
ACROSS CAR
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SALES, COLOR='RED', WHEN=MIN.FLAG EQ 2, $
TYPE=DATA, ACROSSCOLUMN=SALES, COLOR='BLUE', WHEN=MIN.FLAG EQ 4, $
TYPE=DATA, ACROSSCOLUMN=SALES, COLOR='GREEN', WHEN=MIN.FLAG EQ 5, $
ENDSTYLE
END
Hopefully someone else has a better idea...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 15, 2008, 11:25 AM
Cyril JoyThanks, Francis.
But why the below code is coloring the columns which has only data. I need the entire portion of the report to be colored? (I use BACKCOLOR instead of COLOR)
DEFINE FILE CAR
FLAG/D4 = SEATS;
END
TABLE FILE CAR
SUM
SALES AS ''
MIN.FLAG NOPRINT
BY COUNTRY
ACROSS SEATS
ACROSS CAR
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SALES, BACKCOLOR='RED', WHEN=MIN.FLAG EQ 2, $
TYPE=DATA, ACROSSCOLUMN=SALES, BACKCOLOR='BLUE', WHEN=MIN.FLAG EQ 4, $
TYPE=DATA, ACROSSCOLUMN=SALES, BACKCOLOR='GREEN', WHEN=MIN.FLAG EQ 5, $
ENDSTYLE
END
Regards,
Cyril Joy.
WF Production 8008 on Linux.
May 15, 2008, 12:03 PM
Francis MarianiUnfortunately this is because data rows do not exist. For example, England-Alfa Romeo does not exist, therefore there is no SEAT or FLAG value for England-Alfa Romeo.
It looks like this solution will not work. I don't have any other ideas...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 15, 2008, 03:19 PM
k.laneWhat do you mean by "entire portion of the report to be colored"? If you're only interested in coloring the data, then if no data exists, as Francis mentioned, then you would not expect it to be colored?
Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Databases: Oracle 10g, SQL Server 2000, DB2.
May 15, 2008, 04:43 PM
mgrackinCyril,
I have two thoughts which I have not tested.
1) set the default background of the data to the color you want as the default.
TYPE=DATA, BACKCOLOR=...,$
2) If number 1 does not work, put another style statement in the stylesheet and set the BACKCOLOR WHEN=SEATS EQ 0,$
Thanks!
Mickey
| FOCUS/WebFOCUS 1990 - 2011 |
May 15, 2008, 05:09 PM
Darin Leepurpose of across is to dynamically display columns as they exists. If only one sort value exists, then there is no column 2 to change colors on. You could use column notation as follows to get what you need. The "ACROSS COUNTRY COLUMNS value and value " I used simply to control the order of the columns.
TABLE FILE CAR
PRINT
CAR
ACROSS COUNTRY
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR='RED',
$
TYPE=DATA,
COLUMN=C3,
BACKCOLOR='BLUE',
$
TYPE=DATA,
COLUMN=C5,
BACKCOLOR='YELLOW',
$
ENDSTYLE
END
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
May 15, 2008, 10:54 PM
Cyril JoyMy code is as shown below. One BY and two ACROSS.
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
ACROSS SEATS
ACROSS CAR
ON TABLE SET STYLE *
END
Basically i need the entire background of every second ACROSS value fields to be colored,by using BACKCOLOR.
Regards,
Cyril Joy.
WF Production 8008 on Linux.
May 19, 2008, 11:52 AM
Darin LeeThe code I posted gives you what you need - just specify every other column starting with C2:
TYPE=DATA,
COLUMN=C2,
BACKCOLOR='RED',
$
TYPE=DATA,
COLUMN=C4,
BACKCOLOR='RED',
$
TYPE=DATA,
COLUMN=C6,
BACKCOLOR='RED',
$
TYPE=DATA,
COLUMN=C8,
BACKCOLOR='RED',
$
TYPE=DATA,
COLUMN=C10,
BACKCOLOR='RED',
$
TYPE=DATA,
COLUMN=C12,
BACKCOLOR='RED',
$
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
May 19, 2008, 12:27 PM
Danny-SRLCyril,
Don't forget the use of DM:
-* File cyril1.fex
TABLE FILE CAR
SUM
RETAIL_COST
BY COUNTRY
ACROSS SEATS
ACROSS CAR
ON TABLE NOTOTAL
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
-REPEAT #YELLOW FOR &I FROM 2 TO 64 STEP 2;
TYPE=DATA,
COLUMN=N&I,
BACKCOLOR='YELLOW',
$
TYPE=TITLE,
COLUMN=N&I,
BACKCOLOR='YELLOW',
$
-#YELLOW
ENDSTYLE
END
Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF