As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
A limitation (?) of the SUBFOOT technique - it doesn't appear to work with multiple ACROSS columns.
Here I have used the regular SUBTOTAL followed by SUBFOOT and HEADALIGN=BODY in the styling.
For the SUBFOOT multiple years I inserted
<ST.FIELD1<ST.FIELD2<ST.FIELD3
repeated as many times as years would fit across the page. However, as you can see, ALL the subtotals are from the final ACROSS year (2012) and are transposed as incorrect values to the previous years:
This message has been edited. Last edited by: George Patton,
Originally posted by George Patton: A limitation (?) of the SUBFOOT technique - it doesn't appear to work with multiple ACROSS columns.
Here I have used the regular SUBTOTAL followed by SUBFOOT and HEADALIGN=BODY in the styling.
For the SUBFOOT multiple years I inserted
<ST.FIELD1<ST.FIELD2<ST.FIELD3
repeated as many times as years would fit across the page. However, as you can see, ALL the subtotals are from the final ACROSS year (2012) and are transposed as incorrect values to the previous years
I know you can enumerate ROWTOTAL columns to match different ACROSS columns, perhaps you can do the same here:
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
When confronted with this type of problem, I usually try our good friend McGuyver.
-* File georgeP01.fex
JOIN BLANK WITH SALES IN CAR TO BLANK IN FSEQ AS M_
DEFINE FILE CAR
BLANK/A1 WITH SALES = ' ';
XBODY/A12=IF COUNTER EQ 1 THEN BODYTYPE ELSE 'TOTAL';
END
TABLE FILE CAR
SUM
CAR.BODY.DEALER_COST AS 'DCOST'
CAR.BODY.RETAIL_COST AS 'RCOST'
CAR.BODY.SALES
BY LOWEST CAR.ORIGIN.COUNTRY
BY COUNTER NOPRINT
BY LOWEST XBODY
ACROSS LOWEST CAR.BODY.SEATS
ACROSS LOWEST CAR.SPECS.MPG IN-GROUPS-OF 10
IF COUNTER LE 2
WHERE MPG GE 10;
ON COUNTRY SKIP-LINE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
PDF is the key, if I output to PDF then I see what you are getting in the subtotal, other formats appear to be OK.
I am sure that Noreen went to great pains to explain all of this behaviour quite a while ago in some publication / summit presentation. If someone has that reference then it may help you out. Failing that at least you'll have a self contained repro if you decide to get the tech heads on support involved!
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
The thinking hat helped on this, so try the following. The worst bit would be a variable number of Years in your across but sizing might limit that to 4 anyway (given your data and letter / A4 sized output?).
EX -LINES 6 EDAPUT MASTER,GEODATA,CV,MEM,FILENAME=GEODATA, SUFFIX=FOC,$
FIELDNAME=CUST , ,A6 ,A6 ,$
FIELDNAME=YEAR , ,A4YY ,A4 ,$
FIELDNAME=FOB , ,D12.2 ,D12.2 ,$
FIELDNAME=KG , ,P9 ,P9 ,$
FIELDNAME=UN , ,P9 ,P9 ,$
-RUN
CREATE FILE GEODATA
MODIFY FILE GEODATA
FREEFORM CUST YEAR FOB KG UN
DATA
BABE ,2009,689538.93,294228,16013,$
BABE ,2010,385511.27,94841,17077,$
BABE ,2011,493086.46,121021,25702,$
BABE ,2012,200308.56,43298,8208,$
BACM ,2009,246.25,125,0,$
BACM ,2010,666.25,325,0,$
BACM ,2011,6185.72,18519,0,$
BACM ,2012,562.50,250,0,$
BAHA ,2009,837902.10,540330,0,$
BAHA ,2010,458235.63,252016,0,$
BAHA ,2011,395499.40,338198,1,$
BAHA ,2012,69732.56,40406,-1,$
BATR ,2009,668858.32,547422,2144,$
BATR ,2010,694805.69,403593,4958,$
BATR ,2011,641214.94,393109,215,$
BATR ,2012,268413.91,161076,3296,$
CABE ,2009,689538.93,294228,16013,$
CABE ,2010,385511.27,94841,17077,$
CABE ,2011,493086.46,121021,25702,$
CABE ,2012,200308.56,43298,8208,$
CACM ,2009,246.25,125,0,$
CACM ,2010,666.25,325,0,$
CACM ,2011,6185.72,18519,0,$
CACM ,2012,562.50,250,0,$
DAHA ,2009,837902.10,540330,0,$
DAHA ,2010,458235.63,252016,0,$
DAHA ,2011,395499.40,338198,1,$
DAHA ,2012,69732.56,40406,-1,$
DATR ,2009,668858.32,547422,2144,$
DATR ,2010,694805.69,403593,4958,$
DATR ,2011,641214.94,393109,215,$
DATR ,2012,268413.91,161076,3296,$
END
DEFINE FILE GEODATA
COUNTRY/A2 WITH CUST = EDIT(CUST,'99$');
END
TABLE FILE GEODATA
SUM FOB AS STFOB
KG AS STKG
UN AS STUN
BY COUNTRY
ACROSS YEAR AS ''
ON TABLE HOLD AS SUBTOTS FORMAT FOCUS INDEX COUNTRY
END
-RUN
JOIN CLEAR *
JOIN COUNTRY WITH CUST IN GEODATA TO COUNTRY IN SUBTOTS TAG T1 AS J1
DEFINE FILE GEODATA
COUNTRY/A2 WITH CUST = EDIT(CUST,'99$');
END
TABLE FILE GEODATA
SUM FOB AS 'FOB'
KG AS 'QTY,(KG)'
UN AS 'QTY,(UN)'
BY COUNTRY NOPRINT
BY CUST AS 'CUST '
ACROSS YEAR AS ''
-* ON COUNTRY SUB-TOTAL AS 'TOTAL'
ON COUNTRY SUBFOOT
"TOTAL<T1.E02<T1.E03<T1.E04<T1.E05<T1.E06<T1.E07<T1.E08<T1.E09<T1.E10<T1.E11<T1.E12<T1.E13"
HEADING CENTER
"<COUNTRY"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET LINES 666666
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE SET STYLE *
GRID=OFF, FONT="ARIAL", SIZE=8, SQUEEZE=ON, ORIENTATION=LANDSCAPE, LEFTGAP=0.12, RIGHTGAP=0.12, $
TYPE=HEADING, BORDER=LIGHT, BACKCOLOR=RGB(000 128 255), COLOR=WHITE, STYLE=+BOLD, SIZE=12, $
TYPE=TITLE, BORDER=LIGHT, BACKCOLOR=RGB(000 128 255), COLOR=WHITE, JUSTIFY=CENTER, STYLE=+BOLD, $
TYPE=ACROSS, BORDER=LIGHT, BACKCOLOR=RGB(000 128 255), COLOR=WHITE, STYLE=+BOLD, $
TYPE=SUBTOTAL, BACKCOLOR=RGB(180 180 180), COLOR=BLACK, STYLE=+BOLD, $
TYPE=SUBFOOT, HEADALIGN=BODY, BORDER=LIGHT, BACKCOLOR=RGB(000 128 255), COLOR=WHITE, STYLE=+BOLD, $
TYPE=DATA, COLUMN=CUST, JUSTIFY=LEFT, STYLE=+BOLD, $
ENDSTYLE
END
-RUN
TThis message has been edited. Last edited by: Tony A,
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Wow, thanks for all the input on this. I hope it will be useful to others as well. HEADALIGN=BODY does restrict ACROSS fields to what will fit on one page, so in this case about 3 or 4 years. I have to leave on a business trip tomorrow, but I may get a chance to play around with it while I'm away. My real fear is that it will work too darn well - and I'll have around 100 reports to modify with this improved technique.....
Maybe you've already tried this, but making your CUST field wide enough may eliminate the two-line SUBTOTAL in PDF format. At least it worked for me using Tony's sample code with PDF output. I added this to the StyleSheet:
TYPE=REPORT, COLUMN=CUST, WRAP=0.5, $
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Originally posted by Danny-SRL: Very ingenious. However, how do you know that there will be 13 fields in the created focus file?
I used the technique that involved first loading a variable with the number of expected ACROSS fields. (Done by means of a TABLE FILE and then using &LINES.) Then I just did this:
-IF &NBR_OF_ACROSS_COLUMNS_NOT_COUNTING_TOTALS NE 1 GOTO NOT1GT;
"<DUMMY_1<GRANDTA<HEAD2<R9.E03<R9.E12"
"<DUMMY_1<DUMMY_2<HEAD3<R9.E05<R9.E14"
"<DUMMY_1<DUMMY_2<HEAD4<R9.E09<R9.E18"
-NOT1GT
-IF &NBR_OF_ACROSS_COLUMNS_NOT_COUNTING_TOTALS NE 2 GOTO NOT2GT;
"<DUMMY_1<GRANDTA<HEAD2<R9.E03<R9.E12<R9.E21"
"<DUMMY_1<DUMMY_2<HEAD3<R9.E05<R9.E14<R9.E23"
"<DUMMY_1<DUMMY_2<HEAD4<R9.E09<R9.E18<R9.E27"
-NOT2GT
-IF &NBR_OF_ACROSS_COLUMNS_NOT_COUNTING_TOTALS NE 3 GOTO NOT3GT;
.
. and so forth, as needed.
.