ActiveReports6 Assembly > DataDynamics.ActiveReports Namespace > ARControl Class : DataField Property |
Gets or sets the field name from the data source to bind to the control.
'Declaration Public Overridable Property DataField As String
public virtual string DataField {get; set;}
When the DataField property is set to a field contained within the DataSource, ActiveReports binds the field's data from each record to the control. The recordset data is first saved into the DataValue property. It then passes through any OutputFormat and is set as the control's text.
The DataField property can also be used to perform calculations using a scripting expression beginning with an equals sign (=). This allows fields to be set up to display calculated results. For example, a TextBox control or a GroupHeader's DataField property can be set to an expression such as "=UnitPrice * Qty" or "=CompanyName.Trim()" where UnitPrice, Qty and CompanyName are members of the report's Fields collection.
When using a parameter in the DataField property of a CheckBox control, a parameter must begin with the equals sign (=).
When using XML, the DataField must be set to a valid XPath expression.
private void rptDataDynamics_ReportStart(object sender, System.EventArgs eArgs) { this.textBox2.DataField = "CustomerID"; }
Private Sub rptDD_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart Me.TextBox2.DataField = "CustomerID" End Sub
private void rptDataDynamics_ReportStart(object sender, System.EventArgs eArgs) { this.textBox2.DataField = "CustomerID"; this.checkBox1.DataField = "=param:Parameter1"; }
Private Sub rptDD_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart Me.TextBox2.DataField = "CustomerID" Me.CheckBox1.DataField = "=param:Parameter1" End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2