ComponentOne VSView Reporting Edition
OnPrint Property

Returns or sets a string containing VBScript code to be executed before the Section is printed (after it is formatted).

Syntax

section.OnPrint[ = value As String ]

Remarks

The OnPrint property contains VBScript instructions that get executed after the fields in the section have been calculated.

For example, the following code adjusts the width of a field based on the value of another field:

Dim theScript$

theScript = "BarFld.Width = SaleAmountMaxFld.Width * (SaleAmountFld / SaleAmountMaxFld)"

vsr.Sections("Detail").OnPrint = theScript

The BarFld field is a green rectangle. By changing its Width property for each detail section , the report creates a bar chart.

The SaleAmountMaxFld contains an expression that calculates the maximum value for the SaleAmount recordset field. The expression is "=Max([SaleAmount])". The value and width of the SaleAmountMaxFld are used to calculate the width of the bar.

Data Type

String

 

 


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

Product Support Forum  |  Documentation Feedback