Focal Point
[CLOSED] Blank Lines & Colours on Subtotal

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

August 26, 2009, 10:39 AM
saggy
[CLOSED] Blank Lines & Colours on Subtotal
I have a requirement where in i need to show up report in colours on the change of sort value of the Subtotal.For eg..
------------------------------------------------
COL1 COL2 COL3

TOTAL ENGLAND
COL1 COL2 COL3

TOTAL JAPAN
TOTAL
------------------------------------------------
all the values for the sort value england should come up in brown including the data and the subtotals
similarly all the values for the sort value japan should come up in some other colour.
Please let me know how this can be done coz i am not able to achieve this functionality through conditional styling.

I also get blank lines on my subtotal and total can any one help me regarding this as previous posts regarding this didn't help much to me.

This message has been edited. Last edited by: Kerry,


7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML


August 26, 2009, 10:58 AM
GinnyJakes
TYPE=DATA,
     BACKCOLOR=( BY=B1 'SILVER' 'FUCHSIA' ),
$


This doesn't do subtotals and you can do up to 4 colors but it might be a start for you.


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
August 26, 2009, 11:51 AM
Darin Lee
From what you describe, there shouldn't be a reason why conditional styling would not work. Must be missing something.

Here's an example:
-* File car.fex
TABLE FILE CAR
PRINT 
     CAR
     DEALER_COST
BY COUNTRY
ON COUNTRY SUBTOTAL AS '*TOTAL'
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=N1 EQ 'ENGLAND',
$
     DEFMACRO=COND0002,
     MACTYPE=RULE,
     WHEN=N1 EQ 'JAPAN',
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=DATA,
     COLUMN=N3,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N3,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=DATA,
     COLUMN=N1,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N1,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=DATA,
     COLUMN=N2,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N2,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=SUBTOTAL,
     BY=1,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=SUBTOTAL,
     BY=1,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
ENDSTYLE
END


Not quite sure what you mean by the blank lines on your subtotal and totals. (unless you're talking about the split-line phenomenon where it says TOTAL on one line and has the values on the next. This is caused by having insufficient width on the first column to display the subtotal heading and has been addressed many times on the forum.)


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
August 26, 2009, 01:34 PM
saggy
Thanks Darin for the code,
but my report can have n number of sort values and how do we deal with it.
for a change in the sort values the colours should be alternating

And on the lines, yes i was talking abt the split line phenomena only please see the code below and its giving multi lines for total and subtotal


quote:
-DEFAULT &RPTFORMAT='EXL2K';
-DEFAULT &SORT_BY='CAR';
-SET &SORT = IF &SORT_BY EQ 'COUNTRY' THEN 'BY COUNTRY' ELSE 'BY CAR';
DEFINE FILE CAR
HLEVEL/A800 WITH COUNTRY = 'A';
END
TABLE FILE CAR
PRINT
CAR
COUNTRY
MODEL
DCOST
RCOST
SALES
COMPUTE PER_SALES/D20CB=(100*(DCOST/RCOST));
BY HLEVEL NOPRINT
BY COUNTRY NOPRINT
ON COUNTRY RECOMPUTE AS ''
ON TABLE RECOMPUTE AS 'Total'
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET SQUEEZE ON
ON TABLE SET BYDISPLAY ON
ON TABLE SET ONLINE-FMT &RPTFORMAT
ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG OFF
ON TABLE SET STYLE *
TYPE=SUBFOOT, HEADALIGN=BODY, STYLE=BOLD, JUSTIFY=RIGHT, $
-*$
TYPE=DATA,
BACKCOLOR=( BY=B1 'SILVER' 'WHITE' ),
$
ENDSTYLE
END

quote:
Re



7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML


August 26, 2009, 04:43 PM
Darin Lee
So you want alternating colors, not based on the value of the sort field. This would take you back to the way I used to do alternating colors, computing a field and then using conditional styling. The following should do it. Notice that it has to use a multi-verb set because you have to compute the value on the sort field instead of the individual line.
-* File car.fex
TABLE FILE CAR
SUM COMPUTE CTR/I1=IF LAST CTR EQ 0 THEN 1 ELSE 0; NOPRINT
BY COUNTRY
PRINT 
     CAR
     DEALER_COST
BY COUNTRY
ON COUNTRY SUBTOTAL AS '*TOTAL'
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=CTR EQ 0,
$
     DEFMACRO=COND0002,
     MACTYPE=RULE,
     WHEN=CTR EQ 1,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=DATA,
     COLUMN=N4,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N4,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=DATA,
     COLUMN=N3,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N3,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=DATA,
     COLUMN=N1,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N1,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=DATA,
     COLUMN=N2,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=DATA,
     COLUMN=N2,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
TYPE=SUBTOTAL,
     BY=1,
     BACKCOLOR='OLIVE',
     MACRO=COND0001,
$
TYPE=SUBTOTAL,
     BY=1,
     BACKCOLOR='YELLOW',
     MACRO=COND0002,
$
ENDSTYLE
END


As for the split-line, this has been addressed many times on the forum, so you can find a lot more examples if you do a search. You'll notice that both of your BY fields have NOPRINT on them which means that there is no space reserved for the "*TOTAL CAR xxxxxx" on the subtotal line. WF has no way of knowing whether this label is going to run over the top of the subtotals in the first column so by default it just splits the line with the label on the first row and subtotals on the second.

There are two ways around this. You can DEFINE a blank dummy field wide enough to hold your subtotals label. This becomes your first sort field. (So if you're using ReportCaster to burst or table of contents feature that relies on the primary sort, this fouls up the report.) You would also have to turn OFF the SQUEEZE and manually set the column widths for the other columns.

You can also manually recreate the subtotals line as a SUBFOOT, embedding ST.field and aligning them with the report columns.

Either way is a pain, but those are your options.


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
August 28, 2009, 01:21 PM
saggy
thanks darin for your post.I am getting hold of things slowly.But for the split line as you suggested to include the subtotals in subfoot but i am using recompute at subtotals so the values will not get recomputed if i use ST in subfoot.any additions on this


7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML