Focal Point
[SOLVED] Merge column titles in table

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

April 05, 2012, 11:26 AM
Carlos Dias
[SOLVED] Merge column titles in table
Hello,
How can I add a column title above 2 columns titles, like you see in the following example:


My output is in HTML.
I already try the HEADALIGN option, but I think that is not the answer to my problem.

What I want is a way to group columns.

Thanks,
Carlos Dias

This message has been edited. Last edited by: Carlos Dias,


WebFOCUS version: 7.6
Linux/Windows
HTML, Excel
April 05, 2012, 04:42 PM
Mary Watermann
Carlos,

Have you tried using ACROSS for the Merge Title 1 and 2?

 
TABLE FILE CAR
SUM
DEALER_COST
SALES
ACROSS COUNTRY
END
 


Either that or put the column titles in the heading section and then HEADALIGN will work.


WF 7.6.10, Windows, PDF, Excel
April 06, 2012, 02:50 AM
Danny-SRL
Carlos,

Try this:
  
-* File HEADALIGN1.fex
TABLE FILE CAR
HEADING
"Manufacturers<+>Financial<+0>Physical"
PRINT
RCOST
DCOST
MPG RPM
BY COUNTRY
BY CAR
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, ITEM=1, JUSTIFY=LEFT, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=2, JUSTIFY=CENTER, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=3, JUSTIFY=CENTER, COLSPAN=2, $
ENDSTYLE
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 09, 2012, 06:57 AM
Carlos Dias
Danny,
Works fine... but when I add the following style:
  
TYPE=REPORT,
     COLOR='BLACK',
     FONT='VERDANA',
     UNITS=IN,
     SIZE=7,
     SQUEEZE=ON,
     GRID=ON,
     PAGESIZE='A4',
$
TYPE=TITLE,
     style=bold,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-COLOR=RGB(200 200 200),
     BORDER-BOTTOM-COLOR=RGB(200 200 200),
     BORDER-LEFT-COLOR=RGB(200 200 200),
     BORDER-RIGHT-COLOR=RGB(200 200 200),
$


The result is:


How can I set the style for the header?

Thanks,
Carlos Dias


WebFOCUS version: 7.6
Linux/Windows
HTML, Excel
April 09, 2012, 11:01 AM
Mary Watermann
Carlos,

Try this style sheet:
ON TABLE SET HTMLCSS OFF
ON TABLE SET STYLE *

TYPE=REPORT,
     COLOR='BLACK',
     FONT='VERDANA',
     UNITS=IN,
     SIZE=7,
     SQUEEZE=ON,
     GRID=OFF,
     PAGESIZE='A4',
$
TYPE=TITLE,
     STYLE=-UNDERLINE+BOLD,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-COLOR=RGB(200 200 200),
     BORDER-BOTTOM-COLOR=RGB(200 200 200),
     BORDER-LEFT-COLOR=RGB(200 200 200),
     BORDER-RIGHT-COLOR=RGB(200 200 200),
$

TYPE=HEADING,
     STYLE=BOLD,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
     BORDER=LIGHT,
     BORDER-TOP-COLOR=RGB(200 200 200),
     BORDER-BOTTOM-COLOR=RGB(200 200 200),
     BORDER-LEFT-COLOR=RGB(200 200 200),
     BORDER-RIGHT-COLOR=RGB(200 200 200),
$

TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, ITEM=1, JUSTIFY=LEFT, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=2, JUSTIFY=CENTER, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=3, JUSTIFY=CENTER, COLSPAN=2, $


Note changes: HTMLCSS = OFF and GRID=OFF along with adding color to the Heading Section.


WF 7.6.10, Windows, PDF, Excel
April 09, 2012, 11:04 AM
Danny-SRL
Carlos,

You hit the "Border Problem".
When you use "border" then "grid" is disabled.
Then WF inserts a blank line between the HEADING and the TITLES.

So, using your code, you have 2 possibilities.
1. BORDER
  
-* File HEADALIGN2.fex
TABLE FILE CAR
HEADING
"Manufacturers<+>Financial<+0>Physical"
PRINT
RCOST
DCOST
MPG RPM
BY COUNTRY
BY CAR
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-COLOR=RGB(200 200 200),
     BORDER-BOTTOM-COLOR=RGB(200 200 200),
     BORDER-LEFT-COLOR=RGB(200 200 200),
     BORDER-RIGHT-COLOR=RGB(200 200 200),
     style=bold,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
$
TYPE=HEADING, LINE=1, ITEM=1, JUSTIFY=LEFT, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=2, JUSTIFY=CENTER, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=3, JUSTIFY=CENTER, COLSPAN=2, $
TYPE=REPORT,
     COLOR='BLACK',
     FONT='VERDANA',
     UNITS=IN,
     SIZE=7,
     SQUEEZE=ON,
-*     GRID=ON,
     PAGESIZE='A4',
$
TYPE=TITLE,
     style=bold,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-COLOR=RGB(200 200 200),
     BORDER-BOTTOM-COLOR=RGB(200 200 200),
     BORDER-LEFT-COLOR=RGB(200 200 200),
     BORDER-RIGHT-COLOR=RGB(200 200 200),
$
ENDSTYLE
END


2. GRID
  
-* File HEADALIGN3.fex
TABLE FILE CAR
HEADING
"Manufacturers<+>Financial<+0>Physical"
PRINT
RCOST
DCOST
MPG RPM
BY COUNTRY
BY CAR
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, 
     style=bold,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
$
TYPE=HEADING, LINE=1, ITEM=1, JUSTIFY=LEFT, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=2, JUSTIFY=CENTER, COLSPAN=2, $
TYPE=HEADING, LINE=1, ITEM=3, JUSTIFY=CENTER, COLSPAN=2, $
TYPE=REPORT,
     COLOR='BLACK',
     FONT='VERDANA',
     UNITS=IN,
     SIZE=7,
     SQUEEZE=ON,
     GRID=ON,
     PAGESIZE='A4',
$
TYPE=TITLE,
     style=bold,
     COLOR='WHITE',
     BACKCOLOR=RGB(115 150 191),
$
ENDSTYLE
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 09, 2012, 10:22 PM
njsden
For cases like those, I've given up on WebFOCUS Style Sheets and had to resort to using SUBHEAD + external CSS styling instead. It gives finer control though is only applicable to HTML reports ... still, something to consider as an alternative.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
April 10, 2012, 02:49 AM
Danny-SRL
Carlos,

Thanks for introducing me to the "minus.com" website.
So here are the 2 outputs:
1. BORDER

2. GRID

This message has been edited. Last edited by: Danny-SRL,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF