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     [RESOLVED] How to control a question and its choices to stay on the same pdf page?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[RESOLVED] How to control a question and its choices to stay on the same pdf page?
 Login/Join
 
Silver Member
posted
Our application allows one pdf page to contain many questions and their choices. We do not know in advance how many questions and choices there are. However, it requires that each question and all its choices must be shown on one pdf page, i.e., not break into more than one pdf paged.

Below is an example of report: the c) and d) of question 7 are into the next page (page 2).
Anyone can suggest a solution for this? Thanks!

Questionnaire:

1 . Sam the Sham and the Pharaohs sang a song about "Wooly Bully". What was the song about?

a) A cat
b) A car
c) Laundry detergent
d) President Johnson

2 . Who plays slide guitar on the Derek and the Dominos song "Layla"?

a) George Harrison
b) Bonnie Raitt
c) Duane Allman
d) Robert Johnson

3 .
a) ...
b) ....
c) ...
d) ......

4 .
a) ...
b) ....
c) ...
d) ......

5 .
a) ...
b) ....
c) ...
d) ......

6 .
a) ...
b) ....
c) ...
d) ......

7 . Who was the drummer for Pink Floyd?

a) Ginger Baker
b) David Gilmour


*** Page 1***

c) Charlie Watts
d) Nick Mason

8 . What instrument was played by the namesake of The Dave Clark Five?

a) Hammond Organ
b) Drums
c) Saxophone
d) Guitar

*** Page 2 ***

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


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Expert
posted Hide Post
Perhaps the NOSPLIT option will work, but it does depend on how the report is created.

Preventing an Undesirable Split - A page break may occur in the middle of information logically grouped by a sort field, causing one or more group-related lines to appear by themselves on the next page or in the next window. Use the NOSPLIT option to avoid this kind of break. When the value of the sort field changes, the total number of lines related to the new value appear on a new page, including sort headings, sort footings, and subtotals if applicable.

This syntax applies to a PDF or PS report. Use only one NOSPLIT per report request.

{ON|BY} fieldname NOSPLIT

where: ON|BY Is a vertical sort phrase. The terms are synonymous.

fieldname Is the name of the sort field for which sort groups are kept together on the same page.


Perhaps showing us your code might help...


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
Master
posted Hide Post
This is one of those instances where you may have to count the number of lines being generated and cause the report to PAGE-BREAK. On the other hand, if you know the break should always come before Question 7 that shouldn't be too difficult with a WHEN expression.

Here's the help for PAGE-BREAK:

Syntax: How to Insert a Page Break
{ON|BY} fieldname PAGE-BREAK [REPAGE] [WHEN expression;]
where:

ON|BY
Is a vertical sort phrase. The terms are synonymous.

fieldname
Is the sort field on which the page break occurs. Specify the lowest level sort field at which the page break occurs. A page break occurs automatically whenever a higher level sort field changes.

REPAGE
Resets the page number to 1 at each page break or, if combined with WHEN, whenever the WHEN criteria are met.

WHEN expression
Specifies a conditional page break in the printing of a report as determined by a logical expression. See Controlling Report Formatting for details.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Silver Member
posted Hide Post
Thanks Francis and George!

Use {ON|BY} fieldname PAGE-BREAK [REPAGE] [WHEN expression;]
The pdf pages can PAGE-BREAK when QUESTION_NO = 6n (QUESTION_NO = 5n). Please see the code below:

DEFINE FILE HOLD
NUMBREAK/I1=IF HOLD.SEG01.QUESTION_NO = 6 OR HOLD.SEG01.QUESTION_NO = 12 OR HOLD.SEG01.QUESTION_NO = 18 THEN 1
ELSE 0;
END
TABLE FILE HOLD
PRINT
HOLD.SEG01.PREFIX AS ' '
HOLD.SEG01.CHOICES AS ' '
BY HOLD.SEG01.EXAM_NAME NOPRINT
BY HOLD.SEG01.QUESTION_NO NOPRINT
BY HOLD.SEG01.QUESTION NOPRINT
BY HOLD.SEG01.NUMBREAK NOPRINT
ON HOLD.SEG01.NUMBREAK PAGE-BREAK WHEN HOLD.SEG01.NUMBREAK = 1
ON HOLD.SEG01.QUESTION SUBHEAD
" "
"< HOLD.SEG01.QUESTION_NO . < HOLD.SEG01.QUESTION "

The PROBLEMS are:
1) When QUESTION_NO = 6n, undesirable split occurs on QUESTION_NO = 24 due to QUESTION text is too long.
2) When QUESTION_NO = 5n, it seems safe from the undesired split, but it will cause most pages to have big blank section on the bottom of the pages.

--------------------------------

I tried NOSPLIT, but it is not work may be is I don’t use correctly.
Francis, could you provide more information based on the code above?


Another approach from George is COUNT, for the approach:
I can get the total lines from the sql return OR get it from COMPUTE NO/I5 = IF HOLD.SEG01.EXAM_NAME EQ LAST HOLD.SEG01.EXAM_NAME THEN NO + 1 ELSE 1; NOPRINT

But I don’t know how to get the total number of lines of a pdf page and then to control PAGE-BREAK from it.
George, could you provide more help for it?

Thanks!


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Expert
posted Hide Post
I would have started with
BY HOLD.SEG01.EXAM_NAME NOPRINT 
ON HOLD.SEG01.EXAM_NAME NOSPLIT
without calculating anything.


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
Silver Member
posted Hide Post
Thanks for the response!

NOSPLIT indeed works (no other controls, such as: WARP, SKIP-LINE, etc)
HOLD.SEG01.QUESTION_NO NOPRINT
ON HOLD.SEG01.QUESTION_NO NOSPLIT

NOSPLIT doesn’t work/lost function since WRAP:

PRINT
HOLD.SEG01.PREFIX AS ' '
HOLD.SEG01.CHOICES AS ' '
BY HOLD.SEG01.EXAM_NAME NOPRINT
BY HOLD.SEG01.QUESTION_NO NOPRINT
BY HOLD.SEG01.QUESTION NOPRINT
ON HOLD.SEG01.QUESTION_NO NOSPLIT
ON HOLD.SEG01.QUESTION SUBHEAD
" "
"< HOLD.SEG01.QUESTION_NO . < HOLD.SEG01.QUESTION "
.
.
.


TYPE=REPORT,
COLUMN=N5,
WRAP=4.000000,
$


TYPE=HEADING,
LINE=2,
ITEM=2,
WRAP=5.000000,
FONT=ARIAL,
SIZE=10,
$

Could you provide more help for it?


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Expert
posted Hide Post
If NOSPLIT doesn't work with WRAP, of which I am surprised, I wouldn't use WRAP. Do you use SQUEEZE=ON? That will ensure the column widths do not include trailing blanks - this might make the WRAP unnecessary...


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
Silver Member
posted Hide Post
Please see below, I use SQUEEZE=ON.

ON TABLE SET STYLE *
UNITS=IN,
LEFTMARGIN=0.750000,
RIGHTMARGIN=0.750000,
TOPMARGIN=0.100000,
BOTTOMMARGIN=0.10000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$

If no WARP, some CHOICES in the column=n5 and some QUESTION on heading will cross the RIGHTMARGIN of the pdf page and text will be trunked.

Do you know any other options?
Thanks


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Expert
posted Hide Post
WRAP is the only way to control that issue. I'd open a case with Tech Support stating that WRAP and NOSPLIT don't work together.


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
I just tried WRAP with an example from the documentation about NOSPLIT and it works. Make sure you have NOSPLIT on the correct sort field.

SET ONLINE-FMT = PDF
TABLE FILE EMPLOYEE
PRINT DED_CODE AND DED_AMT
BY PAY_DATE BY LAST_NAME 
ON LAST_NAME NOSPLIT 

ON TABLE SET STYLE *

TYPE=REPORT, COLUMN=LAST_NAME, WRAP=2, $
ENDSTYLE
END


quote:
How to: Prevent an Undesirable Split

A page break may occur in the middle of information logically grouped by a sort field, causing one or more group-related lines to appear by themselves on the next page or in the next window. Use the NOSPLIT option to avoid this kind of break. When the value of the sort field changes, the total number of lines related to the new value appear on a new page, including sort headings, sort footings, and subtotals if applicable.

This feature applies to a PDF or PS report.

If you use NOSPLIT with PAGE-BREAK, the PAGE-BREAK must apply to a higher-level sort field. Otherwise, NOSPLIT is ignored. NOSPLIT is also ignored when report output is stored in a HOLD, SAVE, or SAVB file. NOSPLIT is not compatible with the TABLEF command and generates an error message.


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
Silver Member
posted Hide Post
The issue just is marked [RESOLVED], Kerry suggested me to share our solution:

-Francis is right. WRAP with NOSPLIT works together.

-Plus, the following three things need do as well:

(1) remove blank rows from SUBHEAD:

PRINT
HOLD.SEG01.PREFIX AS ' '
HOLD.SEG01.CHOICES AS ' '
BY HOLD.SEG01.EXAM_NAME NOPRINT
BY HOLD.SEG01.QUESTION_NO NOPRINT
BY HOLD.SEG01.QUESTION NOPRINT
ON HOLD.SEG01.QUESTION_NO NOSPLIT
ON HOLD.SEG01.QUESTION SUBHEAD
" "
"< HOLD.SEG01.QUESTION_NO . < HOLD.SEG01.QUESTION "
" "

(2) remove exam name from HEADING

HEADING
"< HOLD.SEG01.EXAM_NAME "
" "

(3) don't use SKIP-LINE when using NOSPLIT

Thanks again for all responses!


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report 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     [RESOLVED] How to control a question and its choices to stay on the same pdf page?

Copyright © 1996-2020 Information Builders