Focal Point
Styling duplicate rows.

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

April 19, 2006, 05:28 PM
amrav
Styling duplicate rows.
I have a report like this:

col1 col2 col3
A 1 2
A 4 5
B 9 8
B 8 8

I need to create a style for each of the values that are in the first column.

For example, In this case, I need to color all rows that has 'A' in the first column should have Color A
and all the rows that has 'B' should have Color B so on and so forth.

Did anybody try this before ?
Appreciate your help.


USA
April 19, 2006, 05:40 PM
Tony A
amrav,

Try this sample
TABLE FILE CAR
SUM DCOST
    RCOST
BY COUNTRY
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=COUNTRY, COLOR=BLUE, WHEN=COUNTRY EQ 'ENGLAND', $
TYPE=DATA, COLUMN=COUNTRY, COLOR=RED, WHEN=COUNTRY EQ 'JAPAN', $
ENDSTYLE
END


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 
April 19, 2006, 05:44 PM
Prarie
TABLE FILE CAR
PRINT SALES CARS COUNTRY
ON TABLE SET STYLE *

TYPE=DATA,COLUMN=N1,COLOR='RED',WHEN=SALES GT 0,$
TYPE=DATA,COLUMN=N2,COLOR='YELLOW',WHEN=CAR EQ 'ALFA ROMEO',$
TYPE=DATA,COLUMN=N3,COLOR='GREEN',WHEN=COUNTRY EQ 'ENGLAND',$
ENDSTYLE
END


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Appreciate your quick response. Tony.

In this case, Nothing is fixed. The values in col1 and number of rows are dynamic.
I can't hard code the value in the WHEN condition.

So far, the idea I can come up with is to find the no.of rows for a particular value in a table file block and then match it to the original hold file and then use that counter(whenever it is > 1) to style it.

I am wondering if there is a more efficient way to do this.


USA
yeah there is...try working with this on the car file...you should get a color change each time the country changes and the color change should be teal first, then yellow for the next country group, and gold for the 3rd.
you can use 2 colors, or more...;
pick softer colors, of course...

TYPE=DATA, BACKCOLOR=(BY=COUNTRY TEAL YELLOW GOLD),$




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Thanks Susannah.
It worked.


USA
Susannah,

Need a little more help with this.

Is there anyway I can specify my own colors using the RGB combinations in the above statement ?

Thanks.


USA
Is this what you are looking for?
TABLE FILE CAR
SUM 
     RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=DATA,
     COLUMN=N3,
     BACKCOLOR=( BY=B1 RGB(0 0 100) RGB(0 100 0) RGB(0 100 100) RGB(100 100 100) ),
$
ENDSTYLE
END

Susannah, I did not know about that!

That's why you're the virtuoso!

Thanks,

Francis.

TABLE FILE CAR
PRINT SALES CARS
BY COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=(BY=COUNTRY TEAL YELLOW GOLD),$
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
hahahahaha Big Grin
amrav, sure, just specify
(BY=COUNTRY RGB(230 255 230) RGB( 255 255 255))
if you want to simulate the old greenbar paper from mainframe printers. It'll alternate rows on your output




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Can you tell me if this function is available in 5.3.3

I tried adding this and it did not change the formatting of my spreadsheet.

Thanks


Web Focus version 7.1.4
Server Windows Server 2003
TABLE FILE CAR
PRINT SALES CARS 
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=(BY=COUNTRY TEAL YELLOW GOLD),$
ENDSTYLE
END


Doesn't style in 5.3.2 but does in 7.1.3 when output is EXL2K.

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