Focal Point
[SOLVED] ACROSSTITLE usage?

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

April 23, 2010, 09:49 AM
Cody
[SOLVED] ACROSSTITLE usage?
Hi Everyone,
I am trying to create a report that has an Across Title for 3 of the 6 columns in the report, but I am not sure how to do this.

Here is what I am hoping my output looks similar to.


Thanks for the help

This message has been edited. Last edited by: Kerry,
April 23, 2010, 10:19 AM
Dan Satchell
You may have to use SUBHEAD or HEADING with BODY=HEADALIGN in the STYLE sheet to do this.


WebFOCUS 7.7.05
April 23, 2010, 10:43 AM
njsden
You won't be able to use actual column TITLES to accomplish what you want so you'll have to resort to using SUBHEAD lines to simulate those titles and use specific stylesheet definitions to format them.

As Dan suggests, you will need to use HEADALIGN=BODY along with COLSPAN=n to make a speficic item span multiple columns. Please keep in mind that this only works for HTML and EXL2K.


I'm yet to find a way to make a title span multiple columns in PDF format ... maybe it is a feature already implemented in the newer version that I've missed?

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



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 23, 2010, 11:02 AM
njsden
One drawback I've found when using SUBHEAD or SUBFOOT is that you *cannot* have borders within the items in it. There can be just one border surrounding the whole SUBHEAD or SUBFOOT, so to simulate your specific report format (including internal borders) your only choice would be using external CSS classes which works for HTML.



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 23, 2010, 11:30 AM
njsden
Cody, here's an example you can use to understand the concept. Once again, this works as is for HTML exclusively.

DEFINE FILE CAR
DUMMY/A1= 'X';
SHP2/D12 = IF SEATS EQ 2 THEN SALES ELSE 0;
SHP4/D12 = IF SEATS EQ 4 THEN SALES ELSE 0;
SHP5/D12 = IF SEATS EQ 5 THEN SALES ELSE 0;
END

TABLE FILE CAR
SUM SHP2  AS ''
    SHP4  AS ''
	SHP5  AS ''
    SALES AS ''
BY DUMMY NOPRINT
BY COUNTRY AS ''
ON DUMMY SUBHEAD
" <+0>Number of Seats<+0> "
"Country<+0>2<+0>4<+0>5<+0>Total"
ON TABLE SET PAGE-NUM NOPAGE
ON TABLE SET HTMLCSS ON
ON TABLE HOLD AS HRESULT FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=REPORT, FONT='ARIAL', SQUEEZE=ON, $
TYPE=DATA, BORDER=LIGHT, $
TYPE=SUBHEAD, HEADALIGN=BODY, CLASS='Title', $
TYPE=SUBHEAD, LINE=1, OBJECT=TEXT, ITEM=2, COLSPAN=3, CLASS='Title', $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<html><head>
<title>Sales by Country</title>
<style type="text/css">
.Title { 
   font-family:Arial; text-align:center; background-color:#c0c0c0;
   border-top: 1.00pt solid #000000; border-bottom: 1.00pt solid #000000; 
   border-right: 1.00pt solid #000000; border-left: 1.00pt solid #000000; 
}
</style>
</head>
<body>!IBI.FIL.HRESULT;</body>
</html>
-HTMLFORM END


Hope this helps!

- Neftali.



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 23, 2010, 11:31 AM
njsden
Oh, I forgot to mention that, in the code I provided, I used data buckets as opposed to relying on ACROSS. It just gives me more control over the "titles" I want to display.



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 23, 2010, 11:38 AM
njsden
Use this one for Excel:

DEFINE FILE CAR
DUMMY/A1= 'X';
SHP2/D12 = IF SEATS EQ 2 THEN SALES ELSE 0;
SHP4/D12 = IF SEATS EQ 4 THEN SALES ELSE 0;
SHP5/D12 = IF SEATS EQ 5 THEN SALES ELSE 0;
END

TABLE FILE CAR
SUM SHP2  AS ''
    SHP4  AS ''
	SHP5  AS ''
    SALES AS ''
BY DUMMY NOPRINT
BY COUNTRY AS ''
ON DUMMY SUBHEAD
" <+0>Number of Seats<+0> "
"Country<+0>2<+0>4<+0>5<+0>Total"
ON TABLE SET PAGE-NUM NOPAGE
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, FONT='ARIAL', SQUEEZE=ON, $
TYPE=SUBHEAD, HEADALIGN=BODY, JUSTIFY=CENTER, BACKCOLOR=SILVER, $
TYPE=SUBHEAD, LINE=1, OBJECT=TEXT, ITEM=2, COLSPAN=3, BORDER=LIGHT, $
ENDSTYLE
END


It has no border definitions as they are not supported for Excel output in your particular version of WF anyway. In fact, borders in Excel output were implemented in WF 7.6.9 but wrong results are obtained when mixing BORDER style with EXL2K FORMULA output format. Well, that's an entirely unrelated matter, I just found the opportunity to vent my frustration a little Razzer

- Neftali.



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 23, 2010, 11:57 AM
Cody
Thanks everyone


WebFOCUS 7.6.8
Linux
HTML,AHTML,PDF