Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How Can We Align the SUBTOTAL Text to a Field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How Can We Align the SUBTOTAL Text to a Field
 Login/Join
 
Expert
posted
Here's the code which produces the following results. What I get and what I want is displayed in the output samples below the code (note the positioning of the "Sub Total:" text):
TABLE FILE CAR
SUM DCOST AS 'Dealer'
RCOST AS 'Retail'
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBTOTAL DCOST RCOST AS 'Sub Total: '
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='LETTER', SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
TYPE=REPORT, FONT='VERDANA', SIZE=8,$
TYPE=TITLE, STYLE=BOLD,$
TYPE=SUBTOTAL, BACKCOLOR=RGB(234 234 234),$
ENDSTYLE
END

What I GET with the above code is:
COUNTRY CAR    MODEL             Dealer    Retail 
ENGLAND JAGUAR V12XKE AUTO           7,427     8,878 
               XJ12L AUTO           11,194    13,491 
       JENSEN  INTERCEPTOR III      14,940    17,850 
       TRIUMPH TR7                   4,292     5,100 
Sub Total: ENGLAND                  37,853    45,319 
FRANCE PEUGEOT 504 4 DOOR            4,631     5,610 
Sub Total: FRANCE                    4,631     5,610 ...and so on...

What I WANT with the above code is:
COUNTRY CAR    MODEL                Dealer    Retail 
ENGLAND JAGUAR V12XKE AUTO           7,427     8,878 
               XJ12L AUTO           11,194    13,491 
       JENSEN  INTERCEPTOR III      14,940    17,850 
       TRIUMPH TR7                   4,292     5,100 
               Sub Total: ENGLAND   37,853    45,319 
FRANCE PEUGEOT 504 4 DOOR            4,631     5,610 
               Sub Total: FRANCE     4,631     5,610 ...and so on...

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




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
I don't think you can get that type of output with a SUBTOTAL. To achieve what you need and to have more control over your output you may prefer to use SUBFOOT instead.

SUBFOOT usually requires more details in your code as nothing happens automatically and you have to resort to spotmarkers in order to properly position each "total" value below its corresponding detail column, particularly when using PDF output.

I am sure there are a few good examples in this forum regarding the use of SUBFOOT and spotmarkers to properly apply style sheet definition to it.

- 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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
Doug,

How's the air in Michigan??? Smiler A little fun!!!

JUSTIFY=RIGHT

  

TABLE FILE CAR
SUM DCOST AS 'Dealer'
RCOST AS 'Retail'
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBTOTAL DCOST RCOST AS 'Sub Total: '
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='LETTER', SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
TYPE=REPORT, FONT='VERDANA', SIZE=8,$
TYPE=TITLE, STYLE=BOLD,$
TYPE=SUBTOTAL, BACKCOLOR=RGB(234 234 234), JUSTIFY=RIGHT,$
ENDSTYLE
END
-EXIT


hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
The following sample uses a SUBTOTAL rendering the output as you'd generally get as well as a SUBFOOT which attempts to produce what you need.

To keep it simple, I make use of HEADLIGN=BODY which makes each element within the SUBFOOT align naturally under each table column in the report body but this works only in HTML/EXL2K. PDF will require a slightly different approach for which you can find some examples in the forum.

TABLE FILE CAR
SUM DCOST AS 'Dealer'
    RCOST AS 'Retail'
COMPUTE	SUBT_LBL/A50 = 'Sub Total: ' | COUNTRY; NOPRINT
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBTOTAL DCOST RCOST AS 'Sub Total: '
ON COUNTRY SUBFOOT
" <0+> <+0><SUBT_LBL<ST.DCOST<ST.RCOST"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='LETTER', SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
TYPE=REPORT, FONT='VERDANA', SIZE=8,$
TYPE=TITLE, STYLE=BOLD,$
TYPE=SUBTOTAL, BACKCOLOR=RGB(234 234 234),$
TYPE=SUBFOOT, BY=COUNTRY, HEADALIGN=BODY, BACKCOLOR='SILVER', JUSTIFY=RIGHT, $
TYPE=SUBFOOT, BY=COUNTRY, OBJECT=FIELD, ITEM=1, JUSTIFY=LEFT, $
ENDSTYLE
END


Hope that 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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
quote:
Tom Flynn: How's the air in Michigan??? Smiler A little fun!!!
AAARRRERrrrgggg... Love The Fun Big Grin
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
quote:
Originally posted by njsden:
... SUBTOTAL rendering the output as you'd generally get as well as a SUBFOOT ...

Not a real option at this point... Been There... Done That... I like your solution... But, this is a mere sample / POC for a much larger "Structured Adhoc" report via a complex launch page...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Doug,

9 times out of 10 I use the RECAP, SUBFOOT and HEADALIGN process, just as Neftali suggests.
I'm sure your POC is more complex then CAR. But, if it is a GUI POC, I think you can still do what Neftali suggests via the GUI.

Hope all is well!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Doug, in the GUI, highlight your subfoot, then activitate the alignment grid via right click. You can do what you want there. However, to run it in either pdf or html, your output will vary. This has been fixed in 7.6.11 so that everything lines up regardless of output selected.


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Expert
posted Hide Post
quote:
This has been fixed in 7.6.11 so that everything lines up regardless of output selected
- It's a miracle!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Thanks Tom and Neftali,

I've been told that 7.6.11 (or 7.7) has this ability (kathy: ... It's been fixed... / Francis: A Miracle)

I can do as suggested for now and wait for more... Music
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Hey Doug,

Yep, BUT, JUSTIFY=RGHT for the SUBTOTAL did do what you wanted in your example...

Not a GUI person, however...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
I hear you loud and clear... I'm Not a GUI person either... But, the GUI can do some stuff... The JUSTIFY=RIGHT will work for now... Thanks...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
OK, Tom, Now I remember why the JUSTIFY=RIGHT won't work... It's because the placement of the "Sub Total:" line varies based on the field name used in the "ON [fieldname] SUBTOTAL". So, sometimes it's justified to the MODEL, and sometimes justified to the CAR or COUNTRY columns...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
OK, Doug, I'm sure there are other caveat's, although, this works in 7.6.10 environment. Don't know which one you're on since your signature keeps changing! Cool

  
TABLE FILE CAR
SUM DCOST AS 'Dealer'
RCOST AS 'Retail'
BY COUNTRY
BY CAR  SUB-TOTAL AS 'Sub Total: '
BY MODEL
-*ON COUNTRY SUBTOTAL DCOST RCOST AS 'Sub Total: '
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='LETTER', SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
TYPE=REPORT, FONT='VERDANA', SIZE=8,$
TYPE=TITLE, STYLE=BOLD,$
TYPE=SUBTOTAL,   BACKCOLOR=RGB(234 234 234), JUSTIFY=RIGHT,$
TYPE=GRANDTOTAL, BACKCOLOR='LIGHT BLUE',     JUSTIFY=RIGHT,$
ENDSTYLE
END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
That would give him a subtotal line for each of the BY fields above, so he would get a subtotal on CAR as well as a subtotal on COUNTRY.

My understanding is that he needs a SUBTOTAL on COUNTRY but it should be displayed under the MODEL column, but with the "Sub-Total:" label being LEFT-justified at all times.

I'm not sure that can be accomplished with a regular SUBTOTAL a/o SUB-TOTAL and that's why I suggested the use of SUBFOOT which in my experience is the only one that provides such a flexibility although you won't get BORDERS in between each item in the SUBFOOT or at least not in PDF. Well, there are always "cons" with each approach Frowner

- 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.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
quote:
Now I remember why the JUSTIFY=RIGHT won't work... It's because the placement of the "Sub Total:" line varies based on the field name used in the "ON [fieldname] SUBTOTAL". So, sometimes it's justified to the MODEL, and sometimes justified to the CAR or COUNTRY columns...


Isn't that what he said were the caveat's. I also said 9 times out of 10, I use RECAP, SUBFOOT and HEADALIGN.

"BASED on THE EXAMPLE", the code works, and, it displays "exactly" as he described in his 1st thread. Try running the code...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Yep, Tom, that's right... thanks for keeping this in perspective...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
This is the sledge-hammer approach, but you can use the non-breaking space character to push the SUBTOTAL text to the right.

-SET &XTAB = '&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;' ||
-            '&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;' ||
-            '&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;';
-*
TABLE FILE CAR
 SUM DCOST AS 'Dealer'
     RCOST AS 'Retail'
 BY COUNTRY
 BY CAR
 BY MODEL
 ON COUNTRY SUBTOTAL DCOST RCOST AS '&XTAB Sub Total: '
 ON TABLE PCHOLD FORMAT HTML
 ON TABLE SET PAGE-NUM OFF
 ON TABLE SET STYLE *
  UNITS=IN, PAGESIZE='LETTER', SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
  TYPE=REPORT, FONT='VERDANA', SIZE=8,$
  TYPE=TITLE, STYLE=BOLD,$
  TYPE=SUBTOTAL, BACKCOLOR=RGB(234 234 234), $
 ENDSTYLE
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How Can We Align the SUBTOTAL Text to a Field

Copyright © 1996-2020 Information Builders