Returns true or false to let you know if additional pages are due to be rendered.

Syntax

<oRef>.isLastPage( )

<oRef>

An object reference to the report you want to check.

Property of

Report

Description

isLastPage( ) returns true if the current page is the last page of the report, and false if additional pages are to be rendered.

Its main purpose is to allow you to make informed decisions about whether or not to display a button to display additional pages. You may also use isLastPage( ) to display something on the last page of a report.

dBASE Plus does not determine in advance how many pages a report will take. It renders the report one page at a time by filling all the StreamFrame objects on that page with data drawn from the StreamFrame objects’ streamSource. If there is more data to render and all the StreamFrame objects in the page are full, another page is scheduled.

If the page being rendered is before the report’s startPage, the rendering is not output. When rendering to a window (the default), rendering stops once a page is output; the window only displays one page at a time. Rendering to a printer or file renders multiple pages. After the page has finished rendering, if another page is scheduled, it is rendered. The process repeats until all the pages are rendered, or the report’s endPage page is rendered. In that case, the rendering process stops, even though another page may be scheduled.

isLastPage( ) ignores the endPage setting and determines if another page is scheduled to be rendered. It can be reliably called only after the last StreamFrame on a PageTemplate has been rendered, since it is the rendering of StreamFrame objects that determines the scheduling of new pages.

isLastPage( ) is usually called from the canRender event handler for a component attached to the PageTemplate—not in a band—that is defined after all the StreamFrame objects. The order in which objects are created and assigned in the report class constructor directly determines their order of definition and rendering.