ActiveReports3 Request technical support
Formula Property
See Also  Example


Gets or sets a formula used to derive the run-time value. If the formula is not null, it overrides all preceding values. The formula can be any combination of calculated and/or bound fields and literals.

Syntax

Visual Basic (Declaration) 
Public Property Formula As String
Visual Basic (Usage)Copy Code
Dim instance As Field
Dim value As String
 
instance.Formula = value
 
value = instance.Formula
C# 
public string Formula {get; set;}

Example

C#Copy Code
private void rptCalFields_ReportStart(object sender, System.EventArgs e)
{
   
this.field1.DefaultValue = "\"Does not compute\"";
   
this.field1.FieldType = DataDynamics.ActiveReports.FieldTypeEnum.None;
   
this.field1.Formula = "ProductName + UnitPrice";
   
this.field1.Name = "field1";
   
this.field1.Tag = null;
}
Visual BasicCopy Code
Private Sub rptCalFields_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs)
   Me.field1.DefaultValue = """Does not compute"""
   Me.field1.FieldType = DataDynamics.ActiveReports.FieldTypeEnum.None
   Me.field1.Formula = "ProductName + UnitPrice"
   Me.field1.Name = "field1"
   Me.field1.Tag = Nothing
End Sub

See Also