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

Namespace:  C1.C1Report
Assembly:  C1.C1Report.2 (in C1.C1Report.2.dll)

Syntax

C#
[DefaultValueAttribute(null)]
public string OnPrint { get; set; }
Visual Basic
<DefaultValueAttribute(Nothing)> _
Public Property OnPrint As String
	Get
	Set

Remarks

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

Examples

The following code adjusts the width of a field based on the value of another field:

Copy CodeVisual Basic
Dim script As String
script = "BarFld.Width = SaleAmountMaxFld.Width * " & "(SaleAmountFld / SaleAmountMaxFld)"
c1r.Sections.Detail.OnPrint = script
Copy CodeC#
string  script;
script = "BarFld.Width = SaleAmountMaxFld.Width * " + "(SaleAmountFld / SaleAmountMaxFld)";
c1r.Sections.Detail.OnPrint = script;

The BarFld field is a green rectangle. By changing its Field.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.

See Also