Focal Point
[CLOSED] Heading across more than one column

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

January 25, 2012, 12:22 PM
MichaelBalle
[CLOSED] Heading across more than one column
Is there in WebFOCUS a posibility to span the first line of the heading for more than one column and for every column under that big heading to set a heading by its own?

E.g. we have the neccessity to have a heading lets call "Europe" span over more than one column named "Germany", "France", "Italy", ...
We must not use the headings like "Europe, Germany" (in Excel you do that by "concatenate cells")

... or in html code:











Europe
GermanyItalyFrance





Thanks a lot

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


WebFOCUS 7.6, 7.7
Windows, All Output formats
January 25, 2012, 12:32 PM
njsden
Michael, by "Heading" do you mean the column title?

There is no "out-of-the-box" support for that in WebFOCUS that I know of.

When faced with a need like that in HTML, I've had to resort to the use of the actual report HEADING to try and fake that, or in some cases a SUBHEAD. A combination of HEADALIGN=BODY, COLSPAN=m in the Style sheet section will keep you going.

An "easier" approach would be possible if "Europe" existed as an actual value in your table (or you can make it happen with a DEFINE). In that case, you could use ACROSS to have a similar effect?

DEFINE FILE CAR
CONTINENT/A20 = IF COUNTRY EQ 'JAPAN' THEN 'ASIA' ELSE 'EUROPE';
END
TABLE FILE CAR
SUM DEALER_COST
BY CAR
ACROSS CONTINENT AS ''
ACROSS COUNTRY AS ''
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=ACROSSVALUE, JUSTIFY=CENTER, $
END




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.
January 25, 2012, 02:11 PM
John_Edwards
Also look into COLSPAN in the Focus styling notes. I have a heading that puts a single phrase across the top of three columns like this:

TYPE=HEADING, HEADALIGN=BODY, STYLE=BOLD, $
TYPE=HEADING, LINE=4, ITEM=2, COLSPAN=3, JUSTIFY=CENTER, $

I think the HEADALIGN option on the line above it is important. But I think it was a little ornery depending on whether it was html or pdf.

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



January 26, 2012, 04:09 PM
Waz
This also depends on the format of the output.

You can use COLSPAN with HTML and Excel, but PDF will be more dificult.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 02, 2012, 08:53 PM
Mika Keranen
Hi,

COLSPAN is also supported with PDF, just can't remember the WebFOCUS release it was introduced, but the code below works in 7.7.03 (possibly with 7.6.nn, too).

Cheers,
Mika

SET PAGE = NOPAGE

TABLE FILE CAR
SUM SALES
    DEALER_COST
    RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL

HEADING
"Car Sales Report<+0>&DATEDMYY"
" "
"Car Details<+0>Dollar Details"
" "

ON COUNTRY SUBFOOT
"Total Dollars:<ST.SALES<ST.DEALER_COST<ST.RETAIL_COST"
" "

ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT='ARIAL', SIZE=10, SQUEEZE=ON, $
TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, ITEM=1, COLSPAN=4, SIZE=12, JUSTIFY=CENTER, $
TYPE=HEADING, LINE=1, ITEM=2, COLSPAN=2, SIZE=8, JUSTIFY=RIGHT, $
TYPE=HEADING, LINE=3, ITEM=1, COLSPAN=3, JUSTIFY=CENTER, $
TYPE=HEADING, LINE=3, ITEM=2, COLSPAN=3, JUSTIFY=LEFT, $
TYPE=SUBFOOT, HEADALIGN=BODY, STYLE=BOLD, $
TYPE=SUBFOOT, LINE=1, ITEM=1, COLSPAN=3, JUSTIFY=RIGHT, $
ENDSTYLE
END
-RUN



WebFOCUS 7.6.x
PMF 5.2.x
February 03, 2012, 09:07 AM
George Patton
I like it ! Smiler


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
February 03, 2012, 10:49 AM
njsden
If I remember correctly, support in PDF for HEADALIGN=BODY and all the niceties that come with it were introduced in WF 7.6.11.

What I've liked the most about this is that I can now easily position SUBFOOT elements just by using appropriate sport markers (<+0> ) instead of resorting to POSITION=n.



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.
February 03, 2012, 12:23 PM
George Patton
This is a nice technique for headings, footings etc., but after 25 years of (Web)FOCUS one thing I can't now do is indent or right-justify the text for a SUBTOTAL.

The default is:
Column1 Column2 Column3               Column4 Column5 Column6
*TOTAL                                Value1  Value2  Value3

What I want is:
Column1 Column2 Column3               Column4 Column5 Column6
                              Total:  Value1  Value2  Value3

Of course I could use the SUBHEAD technique if I were only subtotalling unique columns, but that doesnt work ACROSS years, for example.

It seems to me I used to be able to do this with:
ON FIELDNAME SUBTOTAL AS 'Total: ' IN 30

But that doesn't work any more...

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
February 03, 2012, 12:46 PM
njsden
I'm with you on that George.

Why is it that we always seem to have to compromise on some functionality that should "just work" ?

TABLE FILE CAR
SUM DEALER_COST AND RETAIL_COST
ACROSS SEATS
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBTOTAL AS 'Total: '
ON TABLE SET STYLE *
TYPE=SUBTOTAL, BY=COUNTRY, BACKCOLOR=SILVER, $
TYPE=SUBTOTAL, BY=COUNTRY, OBJECT=TEXT, ITEM=1, JUSTIFY=RIGHT, $  WebFOCUS doesn't care!
TYPE=GRANDTOTAL, BACKCOLOR=GREY, $
TYPE=GRANDTOTAL, OBJECT=TEXT, ITEM=1, JUSTIFY=RIGHT, $ WebFOCUS doesn't care either!
ENDSTYLE
END




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.
February 03, 2012, 01:17 PM
njsden
Well, the alignment does work up to a certain point:

TABLE FILE CAR
SUM DEALER_COST AND RETAIL_COST
ACROSS SEATS
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBTOTAL AS 'Total: '
ON TABLE SET STYLE *
TYPE=SUBTOTAL, BY=COUNTRY, BACKCOLOR=SILVER, JUSTIFY=RIGHT, $
TYPE=GRANDTOTAL, BACKCOLOR=GREY, JUSTIFY=RIGHT, $
ENDSTYLE
END



But then it messes up the alignment of each individual column although if data elements are right-justified then this should not matter.



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.
February 03, 2012, 01:34 PM
Dan Satchell
Although not as easily addressable as SUBFOOT and SUBHEAD, some styling of SUBFOOT is possible in the StyleSheet:

TABLE FILE CAR
 SUM DEALER_COST
     RETAIL_COST
 ACROSS SEATS
 BY COUNTRY
 BY CAR
 BY MODEL
 ON COUNTRY SUBTOTAL AS 'Total: '
 ON TABLE SET STYLE *
  TYPE=SUBTOTAL, BY=COUNTRY, BACKCOLOR=SILVER, $
  TYPE=SUBTOTAL, BY=COUNTRY, COLUMN=COUNTRY, JUSTIFY=RIGHT, $
  TYPE=SUBTOTAL, BY=COUNTRY, COLUMN=RETAIL_COST(2), STYLE=BOLD+ITALIC, $
  TYPE=GRANDTOTAL, BACKCOLOR=GREY, $
  TYPE=GRANDTOTAL, COLUMN=COUNTRY, JUSTIFY=RIGHT, $
 ENDSTYLE
END



WebFOCUS 7.7.05