Use the textReport.needLines() function to ensure that you have enough space to print a number of consecutive lines without a page break. If the specified number of lines is not available, the report skips to the top of the next page.
textReport.needLines(
numLines INT in)
In the following example, if there are not at least 7 lines available (not counting the footer and margins) on the current page, the subsequent report content will print on the next page of the report:
myReport TextReport = new TextReport();
...
myReport.needLines(7);