Focal Point
How to give font color for alternate row

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

April 20, 2007, 08:24 AM
naveen rao
How to give font color for alternate row
HI
I need to give red and black colour to row data alternately.like for eg.

data1 data2 data3 --->should be in red(row1)
data4 data5 data6 --->should be black(row2)

and so on...
any one know how to do it.
i know it for BACKCOLOR but backcolor does not work for font
April 20, 2007, 08:48 AM
KevinG
Naveen,

The same technique you use for BACKCOLOR should work with COLOR.

Kevin


WF 7.6.10 / WIN-AIX
April 20, 2007, 08:55 AM
naveen rao
quote:
Originally posted by KevinG:
Naveen,

The same technique you use for BACKCOLOR should work with COLOR.

Kevin



HI Kevin ,
thanks for quick response but it does not work .what we do with backcolor is
BACKCOLOR=( 'WHITE' RGB(238 238 238) )
but it is not working with color
April 20, 2007, 09:34 AM
FrankDutch
will this help Naveen?

 DEFINE FILE CAR
PROFIT/D12.2 = RETAIL_COST - DEALER_COST;
END
-*
SET BYDISPLAY = ON
-*
TABLE FILE CAR
PRINT
DEALER_COST
RETAIL_COST
PROFIT
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='SCREEN',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=DATA,
COLOR='PURPLE',
COLUMN=PROFIT,
WHEN=PROFIT GE 5000,
$
TYPE=DATA,
COLOR='RED',
COLUMN=PROFIT,
WHEN=PROFIT LE 999,
$
ENDSTYLE 


it will give you difeerent colors based upon the value of "profit"
do you make use of the GUI?
it can help!




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

April 20, 2007, 09:49 AM
KevinG
Naveen,

Sorry, i should never jump to conclusions when StyleSheets are involed...

Try this;

 TABLE FILE CAR
  PRINT CAR
  COMPUTE LN/I1 = IF LAST LN NE 1 OR 2 THEN 1
                    ELSE IF LAST LN EQ 1 THEN 2
                    ELSE IF LAST LN EQ 2 THEN 1
                    ELSE 3; NOPRINT
  BY COUNTRY
ON TABLE PCHOLD FORMAT HTML

ON TABLE SET STYLE *
TYPE=DATA, COLOR=BLACK, WHEN=LN EQ 1, $
TYPE=DATA, COLOR=RED, WHEN=LN EQ 2, $
ENDSTYLE
END
 



WF 7.6.10 / WIN-AIX
April 20, 2007, 09:54 AM
naveen rao
HI Frank,
Actually i have applied Backcolor for my rows.its grey and white for alternate rows.

now what i want is that whatever is the background color of the row the same color i want for font. in that case the data will not be visible.
this is my actual requirement .. Smiler
April 20, 2007, 10:15 AM
smiths
This may not be your exact requirement, but to alternate background colours by row, simply do this:

TABLE FILE CAR
PRINT 
CAR
BY COUNTRY

ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=('GREY' 'BLACK'), $

ENDSTYLE
END


Regards,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
April 20, 2007, 12:18 PM
FrankDutch
I do not understand this.
you want the font color to be the same as the backcolor or do you want the fontcolor to be the opposite of the backcolor, so black text on white background and white text on black bg?

In that case maybe smiths solution will also work for the fontcolor so

TYPE=DATA, BACKCOLOR=('GREY' 'BLACK'),
COLOR=('BLACK' 'GREY') $

give it a try.




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 27, 2007, 03:49 PM
RCourtemanche
I am trying to use this same technique in excel but it doesn't seem to be working. Other than adding a counter and then coloring those rows is there any other way to get this to work?

TYPE=DATA, BACKCOLOR=(RED RGB(204 204 204)),$

This works for PDF output but not EXL2K.
November 27, 2007, 05:01 PM
RickW
something like this maybe
  
TABLE FILE CAR
LIST CAR COUNTRY 
ON TABLE HOLD 
END
-RUN
TABLE FILE HOLD 
PRINT CAR
AND COMPUTE BAND1/I1=IF (IMOD(LIST, 2, 'I3') NE 0) THEN 0 ELSE 1; NOPRINT
BY COUNTRY 
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE NOTOTAL
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=RED, WHEN=BAND1 EQ 0,$
TYPE=DATA, BACKCOLOR=GREY, WHEN=BAND1 EQ 1,$
ENDSTYLE
END




WebFOCUS 7.6.6/TomCat/Win2003,SQL Server 2005,Oracle
November 27, 2007, 05:15 PM
Francis Mariani
Why on earth does this not work in 5.3.2:

TABLE FILE CAR
PRINT 
CAR
BY COUNTRY

ON TABLE SET STYLE *
TYPE=DATA, COLOR=( RGB(243 244 248) RGB(255 255 255) ), $

ENDSTYLE
END


Substitute COLOR with BACKCOLOR and it works:

TABLE FILE CAR
PRINT 
CAR
BY COUNTRY

ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=( RED BLUE ), $

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 27, 2007, 05:28 PM
Prarie
Apparently there was a problem with this all the way up till 7.13. Ricks solution will be a work around.
Francis when did you say you might get upgrade?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Hi,

You can use the following code block to achieve alternate coloring.

TYPE=DATA,
BACKCOLOR=(RGB(245 245 245) RGB(255 255 255)),
$


Thanks and Regards,
Aravindbaalaaji
Thanks everyone for the feedback. I'm on WF 5.24.
TYPE=DATA, BACKCOLOR=(RGB(245 245 245) RGB(255 255 255)), $
The code above doesn't seem to work for EXL2K, however I was able to get it to work with a counter and the following code...
TYPE=DATA, BACKCOLOR=RGB(204 204 204), WHEN=CNT_TICKER EQ 5,$
This essentially colors every 5th row.

Thanks again everyone!

Ryan
Prarie, the client I will be working for in Jan 2008 will be upgrading early in the new year - I'm keeping my fingers crossed that it won't be as painful as some of the upgrades described here.


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
Francis,

We jumped from 533 to 762 (after trying 760 and 761) and the upgrade was reasonably successful. We tried to upgrade to 714 last year and couldn't get it to work well with WebSphere 5.

Other than a few open cases, things are going well finally. Just be prepared for a LOT of behaviour changes and code tightening.

Have fun!


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
Ryan,

TYPE=DATA, BACKCOLOR=(RGB(245 245 245) RGB(255 255 255)), $

should work with Excel in 5.2.4, the problem may be that the not all colors can be produced in Excel and colors are too close. Excel translates them both to white. Try using (RGB(200 200 200) RGB(255 255 255)),$
OR ('SILVER' 'WHITE'),$


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
the thing about excel (at least xp) is that it takes your rgb values and converts it to what BillGates decides is the closest of its 40 available color values. and sometimes the combinations it produces are wicked icky; The actual rgb/hex values of those excel colors you can get here; and they're *not* just the named unix color set we use in wf by name.
so, when you use multiple formats with 1 fex,
i suggest
-SET &myback = IF &FMT IS 'EXCEL' THEN 'RGB(..)' ELSE 'RGB(...)';
and then use
BACKCOLOR=&myback, COLOR=&mycolor
Works for me.
In excel 2007, that's s'posed to all go away
and you're s'posed to have full rgb range.
anybody know?

oh yeah, one more thing, Naveen..PLEASE UPDATE YOUR SIGNATURE.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID