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.
That doesn't quite make sense. A subhead is intended to print each time there's a change in the value of the sort field with which the subhead is associated. Are you looking, perhaps, for a page heading? Or maybe you just want a page break every time you get a new subhead?
dwf
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005
As noted by "dwf", the SUBHEAD is only printed when the sort field value changes. If the sort field value change does not conincide with a page break, you won't get the SUBHEAD text to repeat on the next page.
A couple of suggestions would be:
1) Try using HEADING since this appears on every page which "dwf" noted.
2) You could try the NOSPLIT keyword which attempts to keep records for the same sort value on the same page. In other words, it tries to avoid doing a page break in the middle of a section. However, if you have 100 records for a section there is no way to avoid a page break in the section and therefore you are stuck with the same problem.
Wouldn't it be nice to be able to do an
ON PAGE SUBHEAD or SUBFOOT
Hmm, sounds like a new feature request.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
I understand that the subhead is intented to print each time the value of a sort field changes. However there are times then the records under that subhead continues to the next page and I would like to be able to print the subhead again. Thanks.
I won't say there's no way to do that, as I have done that sort of thing before, but there is no way that could remotely be described as straightforward. Mickey's suggestion to use NOSPLIT would be a few thousand times easier. Of course, if your sections tend to be a hundred lines long, that isn't going to help.
The only way I know to do what you want is to use Modify or Maintain to build a file that is constructed in a manner such that the TABLE FILE has almost no work to do. It is extremely involved, and it would be impossible to describe the procedure in any detail here, but essentially, you take the output of your current TABLE FILE (sans any formatting such as heading, subfoot, etc), SAVE it and run it through Modify or Maintain to create a FOCUS file. Along the way, you create a numeric field (call it S_HEAD, maybe) that increments at every point where you want a subhead. So for the first few records, it would be 1. At the point where you want a subhead, it changes to 2. Stays 2 until you need a another subhead, at which point it changes to 3. Etc. Note that this value might change when some sort value changes, or it might change when your line counter (which you are also calculating) reaches a predetermined value (50, 55, whatever). You TABLE FILE this file, PRINT fields by S_HEAD, ON S_HEAD SUBHEAD.
It's more involved that it probably sounds, and it is a lot of work. You have to want that repeated subhead pretty bad to undertake it.
Don't know if that helped, but it's the only idea I've got.
dwf
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005
lia, what you are asking does make sence. because I do it. I have a large amount of data and need the sub-head to reprint on the next page so that the user knows what the group is. Here is an example using ggsales.
TABLE FILE GGSALES
HEADING
"Page <TABPAGENO"
SUM
DOLLARS
BUDDOLLARS
AND COMPUTE ROWCNT/I9 = LAST ROWCNT + 1; NOPRINT
BY REGION NOPRINT
BY ST
BY CITY
BY STCD
BY PRODUCT
BY TOTAL ROWCNT NOPRINT
ON ROWCNT SUBHEAD
"Region: <REGION "
WHEN REGION NE LAST REGION OR TABPAGENO NE LAST TABPAGENO;
WHERE READLIMIT EQ 1000
ON TABLE SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=ON,
FONT='TIMES NEW ROMAN',
SIZE=10,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=SUBHEAD, BY=6, BACKCOLOR=YELLOW,$
ENDSTYLE
END
I like your solution. It works very nicely although, being one who is familiar with the internals of TABLE request processing, it makes me go bananas trying to think it through as to WHY it works.
The big secret here is that you are forcing a SUBHEAD on a COMPUTEd field which is sorted using the BY TOTAL statement. This is critical since the BY TOTAL is processed after all other sorting and aggregation. :s
Another thing that makes me flinch is the use of the OR on the WHEN clause. The WF 7.1 Reporting Manual does not document the fact that you can put multiple conditions in a WHEN phrase. Is this a hidden feature/7.1.x enhancement not yet documented?
The last thing that makes me nervous is the usage of TABPAGENO in the WHEN phrase. In the past I have tried to do things using the TABPAGENO field in calculations, etc. and have not been very successful. Again, I think it works in your case since you are forcing the SUBHEAD on the BY TOTAL COMPUTEd field.
All things considered, nice job! I will keep this in mind for future needs.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
I do not know if this is a new feature in 7.1x I just started using it last month to accomplish this. As far as the Internals, I don't really know that much. I just work with a lots of customers and try to find ways to meet their needs. I have always said that there is nothing WebFOCUS/FOCUS cannot do it just make take some thinking. I am always glad to help out when I can. To Everyone using Focal Point GREAT JOB and keep it up, helping each other is what makes Focal Point Successful.
Hi TexasStingray, I have to display sub head in each and every page so i am using the "COMPUTE ROWCNT/I9 = LAST ROWCNT + 1; NOPRINT" logic as you mentioned in the above posts.
If the print data(customers name and address) is more then one single page then first page i am getting sub header and few customers, then next page it is printing next customer data and then sub head then customers.
I will submit a JCL to run this Focus program not from the webfocus and PDF format.
is there any way to print sub head then customers in all pages?
I would suggest NOSPLIT to prevent orphaned detail lines.
-- but NOSPLIT does not mix with BY TOTAL:
(FOC1959) NOSPLIT option is not supported in this request NOSPLIT and BY TOTAL can not be used in the same request
The solution is to HOLD the data, including the computed ROWCNT, and then report from HOLD using NOSPLIT (without BY TOTAL) -- as below.
Separately, you can distinguish a "sort-break" subhead from a "page-break" one:
ON ROWCNT SUBHEAD "Region: WHEN REGION NE LAST REGION;
ON ROWCNT SUBHEAD "Region: WHEN REGION EQ LAST REGION AND TABPAGENO NE LAST TABPAGENO;
TABLE FILE GGSALES
SUM
DOLLARS
BUDDOLLARS
AND COMPUTE ROWCNT/I9 = LAST ROWCNT + 1; NOPRINT
BY REGION
BY ST
BY CITY
BY STCD
BY PRO
WHERE READLIMIT EQ 1000
ON TABLE HOLD
END
TABLE FILE HOLD
HEADING
"Page <TABPAGENO"
SUM
DOLLARS
BUDDOLLARS
ROWCNT NOPRINT
BY REGION NOPRINT
BY ST
BY CITY
BY STCD NOSPLIT
BY PRODUCT
BY ROWCNT NOPRINT
ON ROWCNT SUBHEAD
"Region: <REGION "
WHEN REGION NE LAST REGION
ON ROWCNT SUBHEAD
"Region: <REGION| (continued)"
WHEN REGION EQ LAST REGION AND TABPAGENO NE LAST TABPAGENO;
ON TABLE SET STYLE *
[as before]
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Here is my code along with sample data and report format.
************** TABLE FILE ABC SUM COMPUTE TOTALS_MAIN/D10.2M = TOT_PYMT_MAIN; NOPRINT BY MAINDEPTNO AS '' NOPRINT
SUM COMPUTE TOTALS_SUB/D10.2M = TOT_PYMT_SUB; NOPRINT BY MAINDEPTNO AS '' NOPRINT BY SUBDEPTNO AS '' NOPRINT
HEADING "DEPARTMENT DETAILS <120 PAGE NO: <TABPAGENO" "" " MAIN DEPT NUMBER <22 <MAINDEPTNO <40 TOTAL PAYMENTS <TOTALS_MAIN" "" "" PRINT EMPLOYEE_NO NOPRINT AND COMPUTE ROWCNT/I9 = LAST ROWCNT + 1; NOPRINT BY MAINDEPTNO AS '' NOPRINT BY SUBDEPTNO AS '' NOPRINT PAGE-BREAK REPAGE BY TOTAL ROWCNT NOPRINT BY EMPLOYEE_NAME NOPRINT ON EMPLOYEE_NAME SUBHEAD "" "<1<EMPLOYEE_NO <16<EMPLOYEE_NAME <30 <EMPLOYEE_COURSE_NAME" " <16<EMPLOYEE_ADDRESS" " <16<EMPLOYEE_CITY <EMPLOYEE_STATE < EMPLOYEE_ZIP_CODE"
ON ROWCNT SUBHEAD "SUB DEPT NUMBER <22 <SUBDEPTNO <40 SUB DEPT PAYMENTS: <TOTALS_SUB" "NAME <SUBDEPT_NAME " "ADDRESS <SUBDEPT_ADR " " <SUBDEPT_CITY , <SUBDEPT_STATE <SUBDEPT_ZIP " "" "EMPLOYEE NUMBER <16 EMPLOYEE NAME & ADDRESS <30 EMPLOYEE COURSE NAME" "" WHEN SUBDEPTNO NE LAST SUBDEPTNO OR TABPAGENO NE LAST TABPAGENO;
page: 1 Main department no : 100 Sub department no : 100 emp1 emp2
page: 1 Main department no : 100 Sub department no : 101 emp1 emp2
page:1 Main department no : 100 Sub department no : 102 emp1 emp2 emp3
page:2 Main department no : 100 Sub department no : 102 emp4 emp5 emp6
**********************
******** Report format displaed by my program *******
page: 1 Main department no : 100 Sub department no : 100 emp1 emp2
page: 1 Main department no : 100 Sub department no : 101 emp1 emp2
page:1 Main department no : 100 Sub department no : 102 emp1 emp2 emp3
page:2 Main department no : 100 emp4 Sub department no : 102 emp5 emp6
**********************
Actually I want to display employees in Main Department and also in each sub departments.
Main Department number should be displayed in My Header part and sub heading must display the sub department number.
If the main departmet has employees then I am displaying the main department number in sub heading also.
Problem:
For example If I have 10 employees, 7 are getting displayed in first page. In the next page, 8th employee details are displayed before the subhead and then the remaining records.This process repeats in all the subsequent pages.
I am executing Focus program by submitting a JCL which will inturn send report data to mainframe printer.
Please let me know how to make sub head appear before the employee details for each page ? let me know if any code change is required ?This message has been edited. Last edited by: <Jagan>,