Focal Point
[CLOSED] SUBHEAD(sometimes more than 1 subhead) at the top of all pages

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

April 26, 2012, 04:31 AM
SriAravind
[CLOSED] SUBHEAD(sometimes more than 1 subhead) at the top of all pages
Below is the sample code that shows first SUBHEAD(Region) alone at the top of all pages.
  
TABLE FILE GGSALES
PRINT
PRODUCT AS ''
CATEGORY AS ''
PCD AS ''
STCD AS ''
DATE AS ''
DOLLARS AS ''
AND COMPUTE ROWCNT/I9 = LAST ROWCNT + 1; NOPRINT
BY REGION NOPRINT
BY ST NOPRINT
BY CITY NOPRINT
BY TOTAL ROWCNT NOPRINT

ON REGION SUBHEAD
"Region:<8><REGION"

ON ST SUBHEAD
"State:<8><ST"

ON CITY SUBHEAD
" City:<8><CITY"
"<+0>Product<+7>Category<+3>Product code<+4>Store code<+4>Date of sales<+4>Total sales"

ON ROWCNT SUBHEAD
"Region:<8><REGION"
"<+0>Product<+7>Category<+3>Product code<+4>Store code<+4>Date of sales<+4>Total sales"
WHEN TABPAGENO NE LAST TABPAGENO;

ON TABLE SUBFOOT
""
"Total Fulfilled :<ROWCNT"
""
"End of Report."

ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$
TYPE=HEADING, SIZE=10, STYLE=BOLD,$
TYPE=SUBHEAD, STYLE=NORMAL, SIZE=7,$
TYPE=SUBHEAD, COLUMN=N1, SIZE=7, JUSTIFY=CENTER, STYLE=BOLD,$
TYPE=TABHEADING,     SIZE=8,     STYLE=BOLD,$
TYPE=TABFOOTING,     SIZE=8,     STYLE=BOLD,$
TYPE=FOOTING, LINE=1, OBJECT=TEXT, ITEM=1, SIZE=8,$
TYPE=GRANDTOTAL, BACKCOLOR=RGB(210 210 210), STYLE=BOLD,$

ENDSTYLE
END

Suppose if any of the page(other than 1st page) starts with new set of 'State' or 'City'(i.e.different from 1st page State or City names), then the page must be displayed with First header as Region, Second header as State or City respectively.

If old set of State or city records are followed in 2nd page, page shud display only the first header 'Region' only which is displaying now as per above code.

I tried giving various conditions under 'ON ROWCNT SUBHEAD', but could'nt resolve. Can someone provide a solution for this.

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


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
April 26, 2012, 09:30 AM
Prarie
Try adding PAGE-BREAK to each of your sort fields and see if that is what you are looking for.
April 26, 2012, 10:25 AM
SriAravind
If i use PAGE-BREAK for each sort field, then i'm getting below output which i'm not looking for:
 
PAGE - 1
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Region: Midwest
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
.

----AFTER FEW PAGE WHERE 'State' IS CHANGED-----
State: MO
City: St. Louis
Product Category Product code Store code Date of sales Total sales
Region: Midwest
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1250 1997/03/01 24962
Espresso Coffee C141 R1250 1996/11/01 21333
.
.
.


Here first subhead is displayed twice in 1st page and also in other page when my 'State' is changed, 'Region' subhead display next to 'State' subhead.I'm looking for as shown below:
  
PAGE - 1
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
.
-----IF THERE IS NO CHANGE, THEN ONLY FIRST SUBHEAD ALONE DISPLAY (WHICH IS DISPLAYING ALREADY)-------
Region: Midwest
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1250 1997/03/01 24962
.
.
----IF 'State' IS CHANGED, diaplay State subhead next to 'Region' subhead-----
Region: Midwest
State: MO
City: St. Louis
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1250 1997/03/01 24962
Espresso Coffee C141 R1250 1996/11/01 21333
.
.
.



WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
April 26, 2012, 10:47 AM
Tom Flynn
  
APP APPENDPATH IBISAMP
-RUN
TABLE FILE GGSALES
HEADING
"Region:<8><REGION"
PRINT
PRODUCT AS ''
CATEGORY AS ''
PCD AS ''
STCD AS ''
DATE AS ''
DOLLARS AS ''
    COMPUTE ROWCNT1/I9 = IF REGION EQ LAST REGION THEN ROWCNT1 + 1 ELSE 1; NOPRINT
    COMPUTE ROWCNT2/I9 = IF ST     EQ LAST ST     THEN ROWCNT2 + 1 ELSE 1; NOPRINT
    COMPUTE ROWCNT3/I9 = IF CITY   EQ LAST CITY   THEN ROWCNT3 + 1 ELSE 1; NOPRINT
BY REGION NOPRINT
BY ST NOPRINT PAGE-BREAK
BY CITY NOPRINT
-*BY TOTAL ROWCNT NOPRINT

-*ON REGION SUBHEAD
-*"Region:<8><REGION"
-*WHEN ROWCNT1 EQ 1
ON ST SUBHEAD
"State:<8><ST"
WHEN ROWCNT2 EQ 1
ON CITY SUBHEAD
" City:<8><CITY"
"<+0>Product<+7>Category<+3>Product code<+4>Store code<+4>Date of sales<+4>Total sales"
" "
WHEN ROWCNT3 EQ 1
-*ON ROWCNT SUBHEAD
-*"Region:<8><REGION"
-*"<+0>Product<+7>Category<+3>Product code<+4>Store code<+4>Date of sales<+4>Total sales"
-*WHEN TABPAGENO NE LAST TABPAGENO;

ON TABLE SUBFOOT
""
-*"Total Fulfilled :<ROWCNT"
""
"End of Report."

ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$
TYPE=HEADING, LINE=1, SIZE=7, STYLE=BOLD, JUSTIFY=LEFT,$
TYPE=SUBHEAD, STYLE=BOLD, SIZE=7,$
-*TYPE=SUBHEAD, COLUMN=N1, SIZE=7, JUSTIFY=CENTER, STYLE=BOLD,$
TYPE=TABHEADING,     SIZE=8,     STYLE=BOLD,$
TYPE=TABFOOTING,     SIZE=8,     STYLE=BOLD,$
TYPE=FOOTING, LINE=1, OBJECT=TEXT, ITEM=1, SIZE=8,$
TYPE=GRANDTOTAL, BACKCOLOR=RGB(210 210 210), STYLE=BOLD,$

ENDSTYLE
END
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 26, 2012, 10:59 AM
Prarie
Hey Tom...that looks good.

You going to Summit this year?
April 26, 2012, 11:05 AM
Tom Flynn
Hi Linda, Yep, waiting on IBI to open up the selections... Yourself?


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 26, 2012, 02:04 PM
Prarie
I'm in!
April 26, 2012, 02:05 PM
Tom Flynn
Cool Beans!!! C'ya in June...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 27, 2012, 05:31 AM
Rajani
Hi,
Am looking as per below format.On my every page beofre any details i want subhead1(Region).There is no page break in btween.

PAGE - 1
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
.
-----IF THERE IS NO CHANGE FROM PREVIOUS PAGE TO NEXT PAGE, THEN ONLY FIRST SUBHEAD ALONE DETAILS(AS SHOWN BELOW)-------
Region: Midwest
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1250 1997/03/01 24962
.
.
----IF SAME PAGE 'State' IS CHANGED, diaplay State AND CITY subhead -----
State: MO
City: St. Louis
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1250 1997/03/01 24962
Espresso Coffee C141 R1250 1996/11/01 21333
.
.
.
--IF NEW OR NEXT PAGE REGION IS CHANGED THEN AGAIN DISPALY REGION,STATE ,CITY AND DETAILS------
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
.
--IF NEW OR NEXT PAGE STATE IS CHANGED THEN AGAIN DISPALY REGION,STATE ,CITY AND DETAILS------
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
.


WebFOCUS 7.6
Windows, All Outputs
April 30, 2012, 02:24 AM
SriAravind
Tom, i want to display the columns names also in all pages.

i.e.above the records, i need to display columns names as shown below:
  
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
.
.


Right now these columns names are not displayed in all pages


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
April 30, 2012, 08:23 AM
Rajani
Hi,
i want to move BY field in next page if it is the last line of current page.

PAGE - 1
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
Espresso Coffee C141 R1020 1997/04/01 20046
State: ML
---Page End
--page 2
City: Chica

Product Category Product code Store code Date
.
.
.
---------------------------------
what i expected

PAGE - 1
Region: Midwest
State: IL
City: Chicago
Product Category Product code Store code Date of sales Total sales
Espresso Coffee C141 R1020 1996/09/01 24510
Espresso Coffee C141 R1020 1997/04/01 20046
.
.
Espresso Coffee C141 R1020 1997/04/01 20046
. blank space
---Page End
page-2
State: ML
City: Chica
Product Category Product code Store code Date
.
.
.
--------------------------------------


WebFOCUS 7.6
Windows, All Outputs
April 30, 2012, 12:02 PM
Darin Lee
HEADING is for headings that appear on the top of every page. (These can still contain embedded fields so you may find that useful in finding your solution.) SUBHEAD is controlled by the BY fields used. They appear only when sort values change which may or may not be at the top of a page. The only way to force them to be at the top is to page-break on the BY field as well. Subheadings always appear beneath the column headings. (All of this behavior is described in the documentation so that would be a good place to start.) If you want subheadings to appear above the column headings, you have to put AS '' on each of the SUM/PRINT/BY fields and then insert your column headings as part of the SUBHEAD. I would suggest creating DEFINE/COMPUTE fields and inserting them in your HEADING/SUBHEAD as needed.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat