Focal Point
STYLESHEET question

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

May 29, 2008, 11:11 AM
Microfich
STYLESHEET question
Basic request:

TABLE FILE T1
SUM VERBOBJ AS ' '
ACROSS EFFDATE
BY REPORT_NUMBER NOPRINT
BY ROWTITLE AS 'Label'
IF REPORT_NUMBER LE 4
ON TABLE SET ONLINE-FMT EXL2K
ON TABLE SET STYLE *
.
.
.
END

Note: VERBOBJ and ROWTITLE will be different fields depending on REPORT_NUMBER value. I used a MacGyver technique to accomplish this because I really have over 100 fields, not just the 4 sample rows shown here.

Report looks like this (sorry about the dots and dashes):

...................EFFDATE
Label...........01/06..........05/07...........02/08
NAME_____J.Smith_____J.Smith_____J.Smith
ADDRESS__11 Main St.__99 Elm St.__88 Sycamore St.
CITY______New York___Islip_______Boston
STATE_____NY________NY________MA



I'd like to BOLD the cell that has a different value than the value for the previous EFFDATE.

In this example, 99 Elm St. and Islip w/b bolded in EFFDATE column 05/07 and 80 Sycamore St., Boston and MA would be bold in EFFDATE column 02/08.

I've tried many styling combos without luck.

Any stylegurus out there?

Thanks!


WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
May 29, 2008, 11:29 AM
nubi
im no style guru but saw a similar problem solved using computed fields- ie set up a compute which identifies the field that matches your requirement and set that as a flag- then on the style sheet do a when statement to turn text bold when the flag is present.

basically get WF to identify your field values and then use the styling when statements

can someone with better explanatory skills help if Micro doesn't understand as im off for the day now.


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
May 29, 2008, 11:48 AM
Francis Mariani
I hope this illustrates what nubi suggested.

I haven't found a way to do it in one pass through the data.

SET ASNAMES=ON
SET HOLDLIST=PRINTONLY

DEFINE FILE CAR
WIDTHX/P7 = WIDTH;
END

TABLE FILE CAR
SUM
MIN.HEIGHT AS ''
BY COUNTRY
ACROSS WIDTHX
ON TABLE HOLD AS H001
END

?FF H001

TABLE FILE H001
PRINT *

COMPUTE E09FLAG/A1 = IF E09 NE E08 THEN 'Y' ELSE 'N'; NOPRINT
COMPUTE E08FLAG/A1 = IF E08 NE E07 THEN 'Y' ELSE 'N'; NOPRINT
COMPUTE E07FLAG/A1 = IF E07 NE E06 THEN 'Y' ELSE 'N'; NOPRINT
COMPUTE E06FLAG/A1 = IF E06 NE E05 THEN 'Y' ELSE 'N'; NOPRINT
COMPUTE E05FLAG/A1 = IF E05 NE E04 THEN 'Y' ELSE 'N'; NOPRINT
COMPUTE E04FLAG/A1 = IF E04 NE E03 THEN 'Y' ELSE 'N'; NOPRINT
COMPUTE E03FLAG/A1 = IF E03 NE E02 THEN 'Y' ELSE 'N'; NOPRINT

ON TABLE SET STYLE *
TYPE=DATA, COLUMN=E09, COLOR=RED, WHEN= E09FLAG EQ 'Y', $
TYPE=DATA, COLUMN=E08, COLOR=RED, WHEN= E08FLAG EQ 'Y', $
TYPE=DATA, COLUMN=E07, COLOR=RED, WHEN= E07FLAG EQ 'Y', $
TYPE=DATA, COLUMN=E06, COLOR=RED, WHEN= E06FLAG EQ 'Y', $
TYPE=DATA, COLUMN=E05, COLOR=RED, WHEN= E05FLAG EQ 'Y', $
TYPE=DATA, COLUMN=E04, COLOR=RED, WHEN= E04FLAG EQ 'Y', $
TYPE=DATA, COLUMN=E03, COLOR=RED, WHEN= E03FLAG EQ 'Y', $
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
May 29, 2008, 11:57 AM
Microfich
Thanks, Nubi. I had already successfully utilized the method you cite but would rather not code for every field (over 100). I was hoping there was some combo of STYLE statements that would do the trick.

Anyone else?


WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
May 29, 2008, 01:08 PM
Darin Lee
You can avail yourself of the Dialogue Manager loop, throw in a couple counters with &variables and let it generate the code instead of having to hardcode all of it.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
May 29, 2008, 01:09 PM
mgrackin
Microfich,

Try something like this. The key is to use the LAST keyword.

TABLE FILE EMPLOYEE
SUM JOB_DESC
COMPUTE JOBFLG/A1=
IF (EMP_ID EQ LAST EMP_ID) AND (JOB_DESC NE LAST JOB_DESC)
THEN '@' ELSE ' '; NOPRINT
BY EMP_ID
BY LAST_NAME
ACROSS DAT_INC
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=JOB_DESC, COLOR=RED, STYLE=BOLD, WHEN=JOBFLG EQ '@',$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
May 29, 2008, 01:20 PM
Microfich
Thanks, all!

I have succeeded via a combo of all your suggestions.


WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
June 02, 2008, 06:24 AM
nubi
Hi Micro,

Glad you sorted it- yes the problem is i don't think you can use LAST statements within Style Sheet code so you would have to set a flag for that which will involve doing it for every field you want...

but if your styling is based on over 100 variables im not sure how you would get a good solution without hard coding every line or using some clever looping...


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor