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     ON field PAGE-BREAK problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
ON field PAGE-BREAK problem
 Login/Join
 
Gold member
posted
Hi All,

I have the following code :
  
DEFINE FILE CAR
LINE/I4 WITH MODEL= IF LINE EQ 10 THEN 1 ELSE LINE+1;
END
-RUN
TABLE FILE CAR
PRINT MODEL 
COUNTRY
LINE
ON LINE PAGE-BREAK
WHEN LINE EQ 10
END


The problem is related with PAGE-BREAK command, I want to break the page when the line is equal to 10.

This does not works, do you know why?


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
 
Posts: 72 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
Page break is related to a BY field for what you want to do. If you only want ten lines of data on a page, consider the heading lines and any footing lines and do a SET on the LINES and PAGE.

Check out page formatting in the documentation.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
I know that I can use LINES AND PAGE but I want to create a conditional PAGE-BREAK, for example:
  
ON LINE PAGE-BREAK
WHEN (LINE EQ 10) OR ((LINE EQ 5) AND (MODEL EQ 'XXXXX'))
 


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
 
Posts: 72 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
Would have to test, but you still need to sort to do an ON whatever and I don't know if page-break is one you can put a condition on without doing some research. Never had to even try mostly why.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Car file is kind of hard to use as an example on this, but if you change the LINE to BY LINE your WHEN conditions should work. Of course if you don't want line on the report be sure to NOPRINT and do you want it within another BY field?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Traditionally I would do this with 2 DEFINEd fields.
DEFINE FILE CAR
LINE/I4 WITH MODEL= IF LINE EQ 10 THEN 1 ELSE LINE+1;
BREAKPOINT/I4 = IF ((LINE EQ 10) OR ((LINE EQ 5) AND (MODEL EQ 'XXXX'))) THEN BREAKPOINT+1 ELSE BREAKPOINT;
END
-RUN
TABLE FILE CAR
PRINT MODEL 
COUNTRY
BY BREAKPOINT NOPRINT
ON BREAKPOINT PAGE-BREAK
END

though there may be a 'more modern' approach.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Guru
posted Hide Post
Be careful using the words LINE and PAGE. These MAY be reserved words in WebFOCUS. I often use a variable such as LINE_CTR so that it is clearer to the next person who sees my code.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Virtuoso
posted Hide Post
Others have already given the answer - you MUST have a BY field to to use PAGE-BREAK (that part is pretty clear from the documentation.) Given that, you've got to figure out another way to do it. Your problem is if you put BY LINE then you get the lines out of order so you need a combination of PAGENO and LINENO. Every time lineno reaches ten or model eq xxxx then increment pageno and set lineno=1.

Then a simple
BY PAGENO NOPRINT
BY LINENO NOPRINT
ON PAGENO PAGE-BREAK


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
Alan beat me to the punch - and jimster's note is also important!


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
I don't believe LINE would be a reserved word, LINES maybe. There is a list of watch words here.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
The following code works for me:
DEFINE FILE CAR
LINE/I4 WITH MODEL = IF LINE EQ 10 THEN 1 ELSE LINE+1;
END

TABLE FILE CAR
HEADING
"PAGE <TABPAGENO"
PRINT MODEL
BY COUNTRY
BY LINE
ON LINE PAGE-BREAK
WHEN LINE EQ 10;
END

In the example given, the LINE was calculated with MODEL, and if you then do a BY on it, it never gets higher than 10, so it will never break the page. Adding the BY COUNTRY will do the trick.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
And if you compare the results of GamP's code to Alan's, you'll see that the lines and numbers are completely out of order by adding COUNTRY. Alan's code does the trick just fine.


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 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     ON field PAGE-BREAK problem

Copyright © 1996-2020 Information Builders