TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS i get 3 columns, for 2-seater, 3-seater, 4-seater i want alternate column styling. not row, the 3-seater to be BLUE. TYPE=___?__ , ? ,BACKCOLOR=(RED BLUE),$ i've tried everything i can think of making me crazy. I could go ACROSS somekey NOPRINT and then do conditional styling based on key but i'ld rather stick needles in my eyes. Help??
nb: (just adding the keywords ALTERNATE ACROSS to this thread)This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
November 13, 2007, 03:33 PM
Spence
this may help:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS HEADING "" FOOTING "" ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$ TYPE=DATA, COLUMN=N2, BACKCOLOR=RED,$ TYPE=DATA, COLUMN=N3, BACKCOLOR=BLUE, COLOR=WHITE,$ TYPE=DATA, COLUMN=N4, BACKCOLOR=RED,$ ENDSTYLE END
WF 8 version 8.2.04. Windows. In focus since 1990.
November 13, 2007, 03:44 PM
Francis Mariani
A variation:
TABLE FILE CAR
SUM
SALES
BY COUNTRY
ACROSS SEATS
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$
TYPE=DATA, BACKCOLOR=WHITE,$
-REPEAT ENDREPS1 FOR &I FROM 2 TO 24 STEP 2;
TYPE=DATA, COLUMN=N&I, BACKCOLOR=RGB(200 200 200),$
TYPE=ACROSSVALUE, COLUMN=N&I, BACKCOLOR=RGB(200 200 200),$
-ENDREPS1
ENDSTYLE
END
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
November 13, 2007, 04:09 PM
mgrackin
If you have two verb objects such as in the following example, you can simply use the ACROSSCOLUMN syntax.
TABLE FILE CAR SUM RCOST DCOST BY COUNTRY BY CAR ACROSS SEATS ON TABLE SET STYLE * TYPE=DATA, ACROSSCOLUMN=RCOST, BACKCOLOR=CYAN,$ TYPE=DATA, ACROSSCOLUMN=DCOST, BACKCOLOR=YELLOW,$ ENDSTYLE END
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
November 13, 2007, 04:12 PM
Spence
francis:
FROM 2 TO 24 STEP 2; this is saying every other number starting from 2 and ending at 24?
The STEP could be any increment? Thanks Francis i've needed to do this also.
-*********************************************************** -REPEAT ENDREPS2 FOR &i FROM 3 TO 24 STEP 2; TYPE=DATA, COLUMN=N&i, BACKCOLOR=BLUE, COLOR=WHITE,$ TYPE=ACROSSVALUE, COLUMN=N&i, BACKCOLOR=BLUE, COLOR=WHITE,$ -ENDREPS2 -*********************************************************** -REPEAT ENDREPS1 FOR &I FROM 2 TO 24 STEP 2; TYPE=DATA, COLUMN=N&I, BACKCOLOR=RED,$ TYPE=ACROSSVALUE, COLUMN=N&I, BACKCOLOR=RED,$ -ENDREPS1 -***********************************************************
WF 8 version 8.2.04. Windows. In focus since 1990.
November 13, 2007, 04:14 PM
Francis Mariani
STEP could be any increment. It's nicer than incrementing a counter yourself. The REPEAT loop stops when the counter reaches 24.
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
November 13, 2007, 09:59 PM
susannah
y'all Nn is a verb object, not a column reference. In my case i only have 1 verb object, SALES, aka N1. and i gotta have 2 colors for the same field BACKCOLOR=(RED BLUE),$ its a piece of cake for rows. There's gotta be a way for columns....
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
November 14, 2007, 03:45 AM
Tony A
Susannah,
PM waiting
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
November 14, 2007, 08:57 AM
Spence
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE SET PAGE NOLEAD ON TABLE NOTOTAL ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9, $ -*********************************************************** -REPEAT ENDREPS2 FOR &i FROM 3 TO 24 STEP 2; TYPE=DATA, COLUMN=N&i, BACKCOLOR=( RGB(0 0 255) 'RED' ) ,$ TYPE=ACROSSVALUE, COLUMN=N&i, BACKCOLOR=BLUE, COLOR=WHITE,$ -ENDREPS2 -*********************************************************** -REPEAT ENDREPS1 FOR &I FROM 2 TO 24 STEP 2; TYPE=DATA, COLUMN=N&I, BACKCOLOR=( RGB(255 0 0) 'BLUE' ) ,$ TYPE=ACROSSVALUE, COLUMN=N&I, BACKCOLOR=RED,$ -ENDREPS1 -*********************************************************** TYPE=DATA, BACKCOLOR=( RGB(228 233 233) 'WHITE' ),$ ENDSTYLE END
WF 8 version 8.2.04. Windows. In focus since 1990.
November 14, 2007, 09:17 AM
mgrackin
LOL!
Nice report sample Spence.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
November 14, 2007, 09:23 AM
mgrackin
Spence,
Take a look at the PAGE SOURCE for the report that is created from your code. The CSS is VERY long.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
November 14, 2007, 09:38 AM
Tony A
It may be long, but the overall file size sent to the end users browser is smaller than it might be if he didn't use HTMLCSS ON.
The PM I sent to Susannah earlier had a version of this code within it, which is a combination of Spence and Francis' examples. It should provide the flexiblity for a varying number of columns produced by the ACROSS.
-SET &Column = 'MODEL';
-SET &Colours = 4;
-SET &Colour0 = 'RGB(128 255 255)';
-SET &Colour1 = 'RGB(128 255 128)';
-SET &Colour2 = 'RGB(255 128 128)';
-SET &Colour3 = 'RGB(255 255 128)';
-SET &Colour = 0;
TABLE FILE CAR
BY &Column
ON TABLE SAVE
END
-RUN
-SET &Cols = &LINES;
TABLE FILE CAR
SUM SALES
BY COUNTRY
ACROSS &Column
HEADING
""
FOOTING
""
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT, GRID=OFF, $
TYPE=REPORT, FONT='ARIAL', SIZE=9,$
-REPEAT :Loop FOR &I FROM 1 TO &Cols;
TYPE=REPORT, COLUMN=C&I, BACKCOLOR=&Colour&Colour.EVAL,$
-SET &Colour = IMOD(&I, &Colours, 'I1');
-:Loop
ENDSTYLE
END
Just change the &Column to the column that you want shown across and the &Colours variable to the number of colour changes you want. If you want more colours then you will have to add additional &Colour(n) variable(s) to match.
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
November 14, 2007, 01:07 PM
susannah
you're all wonderful. thanks for your replies. Spence, your code produces a checkerboard, which isn't exactly what i had in mind, but its quite interesting! T, i'll use C# notation, and loop, as you suggest. Very sweet code, thanks. It'll be faster your way than making a key value ACROSS key ACROSS SEATS which requires an interim hold file. Do you all agree that since its a piece of cake for ROWS and since the dreaded Cg-word does it easily, that this is a perfect NFR?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
November 14, 2007, 01:47 PM
FrankDutch
Yes Susannah
A new function together with the ability to change the format of the rowtotal (including row total heading) and row_subtotal.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
November 15, 2007, 07:35 PM
susannah
i went to FUSE today and learned from the BGH that in fact there is no cool quick way to do this in stylesheet, so i'm gonna open an NFR. Would you each do the same, and we might actually get some attn paid to the issue?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID