Navigation: Language Reference > 9 - Window and Report Attributes > Window and Report Attributes >====== WITHNEXT (set widow elimination) ====== | |
WITHNEXT( [siblings] )
WITHNEXT | Specifies the structure is always printed on the same page as print structures PRINTed immediately following it. |
siblings | An integer constant or constant expression that specifies the number of following print structures to print on the same page. If omitted, the default value is one. |
The WITHNEXT attribute (PROP:WITHNEXT) specifies that the DETAIL, or group HEADER or FOOTER structure (contained within a BREAK structure), is always printed on the same page as the specified number of print structures PRINTed immediately following it. This ensures that the structure is never printed on a page by itself, eliminating “widow” print structures. A “widow” print structure is defined as a group header, or first detail item in a related group of items, printed on the preceding page, separated from the rest of its related items.
The siblings parameter, if present, sets the number of following print structures that must be printed on the same page with the structure. To be counted, the following print structures must come from the same, or nested, BREAK structures. They must be related items. Any print structures not within the same, or nested, BREAK structures are printed but not counted as part of the required number of siblings.
Example:
CustRpt REPORT
Break1 BREAK(SomeVariable)
HEADER,WITHNEXT(2) !Always print with 2 siblings
!structure elements
END
CustDetail DETAIL,WITHNEXT() !Always print with 1 sibling
!structure elements
END
FOOTER
!structure elements
END
END
END