VSView Reporting Edition Reference > Section Object > Section Properties > OnPrint Property |
Returns or sets a string containing VBScript code to be executed before the Section is printed (after it is formatted).
section.OnPrint[ = value As String ]
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.
String