Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
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
 
Report 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, 2003Report 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: 104 | Location: Boston | Registered: April 23, 2003Report 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, 2003Report 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
 
Report 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: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report 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.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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, 2003Report 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: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report 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, 2003Report 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, 2005Report 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: 104 | Location: Boston | Registered: April 23, 2003Report 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
 
Report 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, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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

Copyright © 1996-2020 Information Builders