newPage(): Integer updating;
The newPage method of the Printer class skips to the top of a new page and it opens the printer if it is not already open. This method has no effect if the print output is already positioned at the start of a page.
A
An exception is raised if this method is invoked from a server method.
The code fragments in the following examples show the use of the newPage method.
// The variable lastKey contains the key of the last entry to be // displayed on the table. This value is compared with the key of the // last entry in the collection to determine whether the entire collection // has been displayed. If not, the printer is told to start a new page // and the table is cleared. The startPos variable is then set to the // last entry to be displayed so that the next page displays only the // entries which have not yet been displayed. if lastKey < customerDict.last.key then app.printer.newPage; table1.clear; table1.rows := 1; self.setColumnHeadings; self.startPos := lastKey; endif; if cb_NewPage.value then if lineCount mod tb_Lines.text.Integer = 0 then if cb_ChangeMargins.value then leftMargin.text := (leftMargin.text.Integer + 5).String; app.printer.leftMargin := leftMargin.text.Integer; app.printer.rightMargin := rightMargin.text.Integer + 5; endif; app.printer.newPage; endif; endif;