Focal Point
Alternate Color for Acrossvalue

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

January 23, 2008, 08:04 PM
Anatess
Alternate Color for Acrossvalue
Hi guys,

Another elementary question from me...

How do I get the alternate color to work on an acrossvalue? Here's the fex that doesn't work:

TABLE FILE CAR
SUM
     DEALER_COST
BY COUNTRY
ACROSS CAR AS '' ACROSS-TOTAL
ACROSS BODYTYPE AS '' ACROSS-TOTAL
ON COUNTRY SUBTOTAL AS '*TOTAL COUNTRY'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
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=TITLE,
     STYLE=BOLD,
$
TYPE=ACROSSVALUE,
     SIZE=9,
	 STYLE=BOLD,
	 JUSTIFY=CENTER,
	 BACKCOLOR=('LIGHT BLUE' 'YELLOW'),
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR='GRAY',
     STYLE=BOLD,
$
ENDSTYLE
END



WF 8.1.05 Windows
January 24, 2008, 12:12 AM
Alan B
I think that this has to be done manually
.
.
TYPE=ACROSSVALUE,
     ACROSS=CAR,
     SIZE=9,
     STYLE=BOLD,
     JUSTIFY=CENTER,
     BACKCOLOR='LIGHT BLUE',
$
TYPE=ACROSSVALUE,
     ACROSS=MODEL,
     SIZE=9,
     STYLE=BOLD,
     JUSTIFY=CENTER,
     BACKCOLOR='YELLOW',
$
.
.



Alan.
WF 7.705/8.007
January 24, 2008, 02:10 AM
Tony A
As Alan has already said, this is a manual process and not one that is currently catered for within syntax.

Susannah asked this exact same question a short while ago and there were a couple of good methods. Check out this post

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 
January 24, 2008, 10:55 AM
Anatess
whoa. I did the search using ALTERNATE ACROSS and that post didn't come up... or maybe I'm just getting old. But, I really thought it was as easy as alternating row colors... grrr. Thanks y'all.


WF 8.1.05 Windows
January 24, 2008, 12:35 PM
susannah
anatess, i just added the words 'ALTERNATE ACROSS' to the text of that thread, at your suggestion, to help future explorers.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 25, 2008, 04:21 PM
Anatess
Ya know, the post is A-1 definitely... but (I know, I know, sorry!)... it's not quite what I was looking for (and of course, I failed to express myself better above). Doing the loop trick across columns work well for the 2nd Across value, but I was hoping to have alternate colors on the first ACROSS value and not the 2nd. So, like in the sample code I have above, I was hoping that all columns under Alfa Romeo will have the light blue color, then all the columns under Audi would have the yellow color. Since I won't know how many BodyTypes there would be for each Car, I can't figure out a way to do the looping. :-(


WF 8.1.05 Windows
January 26, 2008, 11:14 AM
susannah
..you could cheat...
TABLE FILE CAR SUM CNT.DST.BODYTYPE BY CAR ON TABLE SAVE
END
-RUN
-SET &HOWMANYCARS = &LINES ;
..now -READ your SAVE file




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 28, 2008, 04:36 AM
Tony A
Anatess,

You should be able to use the previous example as a base and build upon it -

-SET &Column = 'CAR';
-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;
-SET &ECHO = ON;
TABLE FILE CAR
SUM SALES
BY COUNTRY
ACROSS &Column
ACROSS MODEL
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 :Loop2 FOR &I FROM 1 TO &Cols;
-READ SAVE, &Parm
  TYPE=REPORT, ACROSSCOLUMN=N1, BACKCOLOR=&Colour&Colour.EVAL, WHEN=&Column EQ '&Parm', $
-SET &Colour = IMOD(&I, &Colours, 'I1');
-:Loop2
ENDSTYLE
END

Haven't tested it but it should be in the right area Smiler

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 
January 28, 2008, 10:24 AM
Anatess
Thanks Susannah, Tony. Now it works perfectly with this code:

-SET &Column = 'CAR';
-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;
-SET &J = 1;
-SET &Knt=0;
TABLE FILE CAR
SUM CNT.DST.MODEL
BY CAR
ON TABLE SAVE
END
-RUN
-SET &Cols = &LINES;
-SET &ECHO = ON;
TABLE FILE CAR
SUM SALES
BY COUNTRY
ACROSS CAR
ACROSS MODEL
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 :Loop2 FOR &I FROM 1 TO &Cols;
-READ SAVE &Kar.16 &Knt.I5
-REPEAT :Loop3 &Knt TIMES
-SET &J = &J+1;
  TYPE=REPORT, COLUMN=N&J, BACKCOLOR=&Colour&Colour.EVAL, $
-:Loop3
-SET &Colour = IMOD(&I, &Colours, 'I1');
-:Loop2
ENDSTYLE
END


This is exactly what I need.


WF 8.1.05 Windows
January 28, 2008, 11:13 AM
Tony A
Glad you found a way.

It would be interesting to see how long it would take to achieve this using only the GUI .....

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 
January 29, 2008, 09:27 AM
Anatess
LOL! I'd venture a guess... Forever?


WF 8.1.05 Windows