ComponentOne VSView Reporting Edition
Page Property

Returns or sets the current page number.

Syntax

[form!]VSReport.Page[ = value As Long ]

Remarks

The Page property is a global variable available to VBScript expressions. It is automatically initialized by the control with the value 1 when a reports starts rendering, and it is automatically incremented after each page break.

The Page variable is typically used in page headers or footers, often in combination with the Pages variable, which provides a global page count for the report. For example, the code below creates a field in the page footer section that displays a "Page n of m" counter. (This could also be done using the Designer).

vsr.Sections(vsrPageFooter).Fields.Add "PageCounterFld", _

    "=""Page "" & [Page] & "" of "" & [Pages]", _

    5000, 0, 5000, 300

vsr.Fields("PageCounterFld").Calculated = True

The Page property is read-write, so you can reset it using scripts. For example, the code below causes the Page variable to be reset to 1 at the beginning of every top-level group:

' assign a VBScript handler to the OnPrint event

' of section "Group 0 Header"

vsr.Sections("Group 0 Header").OnPrint = "Page = 1"

Data Type

Long

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback