PageAcross  PageCountAcross

Chapter 2: DataWindow Expression Functions

PageCount

Description

Gets the total number of pages when viewing a DataWindow object or report in Print Preview. This number is also the number of printed pages if the DataWindow object or report is not wider than the preview window. If the DataWindow object or report is wider than the preview window, the number of printed pages will be greater than PageCount gets.

Syntax

PageCount ( )

Returns

Long. Returns the total number of pages.

Usage

PageCount applies to Print Preview.

NoteCalculating the page count The vertical size of the paper less the top and bottom margins is used to calculate the page count. When the print orientation is landscape, the vertical size of the paper is the shorter dimension of the paper.

Examples

Example 1

This expression returns the number of pages:

PageCount()

Example 2

In the DataWindow object or report’s footer band, this expression for a computed field displays a string showing the current page number and the total number of pages in the report. The result has the format Page n of total:

'Page ' + Page() + ' of ' +  PageCount()

See also





Copyright © 2004. Sybase Inc. All rights reserved. PageCountAcross

View this book as PDF