Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Stylesheet data output with alternate backcolor
Go
New
Search
Notify
Tools
Reply
  
Stylesheet data output with alternate backcolor
 Login/Join
 
<Nathan>
posted
Is there a easy way in webfocus internal
stylesheet or otherwise, so output rows
of data will be shown in alternate background
colors ?

Thanks
 
Reply With QuoteReport This Post
Gold member
posted Hide Post
Yes, I code it by hand in the following manner. Put the code below in the PRINT statement.

COMPUTE COUNTER/I6 = COUNTER + 1; NOPRINT
COMPUTE EVENORODD/I1 = IMOD ( COUNTER , 2 , EVENORODD ); NOPRINT


Then in the style sheet put this:

TYPE=DATA, BACKCOLOR=WHITE, WHEN=EVENORODD EQ 0, $
TYPE=DATA, BACKCOLOR=RGB(245 245 245), WHEN=EVENORODD EQ 1, $

I use white and RGB(245 245 245) (White Smoke) as the alternating colors because I think they look good but you can use any colors you like.
 
Posts: 90 | Location: Tinker AFB | Registered: June 03, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This would make the background color of the first line white and the next line gray.

TYPE=DATA, BACKCOLOR=( 'WHITE' RGB(231 231 231) ), $


Lenny
 
Posts: 105 | Location: Boston | Registered: April 23, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
you can even color chunks of rows , say when a byvalue changes, using this WHEN= technique, all depends how you set up your key. very cool and flexible.
i set up my colors as &vars and load a color palette.
-INCLUDE COLORS1
..fex goes here
TYPE=DATA,COLOR=&RGBALTROW,WHEN=KEY1 EQ 1,$
and for each app i might load a different color palette (COLORS1.fex) to set the &var &RGBALTROW
so in the colors1.fex
-SET &RGBALTROW = 'RGB(245 245 245)';
and lots more colors..
so for one application, &rgbaltrow might be grey
and for another, &rgbaltrow might be pale blue.
same fex, different colors.
just an idea.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
<Nathan>
posted
Thanks Boogarweed, Lenny Ward and Susannah
for the help.

For this particular problem, I went ahead
with Lenny Ward's solution, which worked
fine.

Thanks
 
Reply With QuoteReport This Post
Guru
posted Hide Post
Minor twist on this one, which is great to know:

how would the computes be changed to shade two lines with backcolor white, two lines with some other backcolor?

Happy New Year!


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 239 | Location: Orlando, FL / Baltimore, MD | Registered: May 06, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Sandy,

You could achieve it by
    COMPUTE COUNTER/I6 = COUNTER + 1; NOPRINT
    COMPUTE EVENORODD/I2 = (IMOD ( COUNTER + 1 , 4 , EVENORODD )); NOPRINT
TYPE=DATA, BACKCOLOR=WHITE, WHEN=EVENORODD LE 1, $
TYPE=DATA, BACKCOLOR=RGB(210 210 210), WHEN=EVENORODD GE 2, $


Regards

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
TYPE=DATA, BACKCOLOR=( 'WHITE' RGB(231 231 231) ), $

Lenny! thats so cool
it works
its so easy
wow
thanks
how in the world did you figure that out?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Guru
posted Hide Post
Tony A - Thanks! works like a charm!


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 239 | Location: Orlando, FL / Baltimore, MD | Registered: May 06, 2003Reply With QuoteReport This Post
Virtuoso
posted Hide Post
FYI, You can do this on based a BY phrase as well and you can use more than two colors.

TABLE FILE CAR
PRINT RCOST DCOST
BY COUNTRY
BY CAR
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, COLOR=NAVY, STYLE=BOLD,$
TYPE=DATA, BACKCOLOR=(BY=COUNTRY TEAL YELLOW GOLD),$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
Sandy,

You can do it this way as well:

TYPE=DATA, BACKCOLOR=( BLUE BLUE WHITE WHITE ), $


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I looked in the IBI doc's to find out about alternating background color but could not find it.

I think I found out about it:
BACKCOLOR=( 'WHITE' 'YELLOW' 'LIME' RGB(204 255 255) ),

awhile back by playing around with DevStudio.

The 7.1.3 beta DevStudio allows you to specify 4 alternating colors. You might be able to have more.

Lenny


(Production: WebFOCUS 7.1.3 on Win 2K/IIS 6/CGI)
(Test: WebFOCUS 7.1.3 on Win 2K/IIS 6/CGI)
 
Posts: 105 | Location: Boston | Registered: April 23, 2003Reply With QuoteReport This Post
<RickW>
posted
Just to add another twist on the same thing...

You can also use LIST and then use Boogardweeds method using the E01 alias. You need to make sure your data is already sorted before you use LIST though.

TABLEF FILE CAR
LIST CAR
ON TABLE HOLD
END
-RUN
TABLE FILE HOLD
PRINT CAR
AND COMPUTE BAND1/I1=IF (IMOD(E01, 2, 'I6') NE 0) THEN 0 ELSE 1; NOPRINT
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=RGB(225 229 229), WHEN=BAND1 EQ 0,$
ENDSTYLE
END

Nothing like flexibility Wink
 
Reply With QuoteReport This Post
Silver Member
posted Hide Post
You are over complicating this! There is a feature in the STYLESHEET that lets you color alternating rows with a single command:

TYPE=DATA,
FONT='ARIAL',
COLOR='BLACK',
BACKCOLOR=( 'WHITE' RGB(255 255 224) ),
TOPGAP=0.013889,
BOTTOMGAP=0.027778,
JUSTIFY=RIGHT,
$
The BACKCOLOR attribute is just set to the alternating colors you want, the rest is automatic.


Steve
 
Posts: 44 | Location: New York City | Registered: May 23, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Stylesheet data output with alternate backcolor

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.