See Also

FieldCollection Class  | FieldCollection Members  | Overload List

Language

Visual Basic

C#

Show All

fieldName
The name of the Field in the collection.
See Also Languages ActiveReports Send feedback to Data Dynamics

Item(String) Property

Gets the Field object with the specified name in the FieldCollection.

[Visual Basic]
Overloads Public ReadOnly Property Item( _    ByVal fieldName As String _ ) As Field
[C#]
public Field Item(    string fieldName ); {get;}

Parameters

fieldName
The name of the Field in the collection.

Example

[C#] 

private void UnboundGrp_FetchData(object sender, DataDynamics.ActiveReports.ActiveReport.FetchEventArgs eArgs) 

    try 
    { 
        m_reader.Read(); 
        Fields["CategoryID"].Value = m_reader["categories.CategoryID"].ToString(); 
        Fields["CategoryName"].Value = m_reader["CategoryName"].ToString(); 
        Fields["ProductName"].Value = m_reader["ProductName"].ToString(); 
        Fields["UnitsInStock"].Value = m_reader["UnitsInStock"].ToString(); 
        Fields["Description"].Value = m_reader["Description"].ToString(); 
        Fields["TotalLabel"].Value = "Total Number of " + m_reader["CategoryName"].ToString() + ":"; 
        eArgs.EOF = false; 
    } 
    catch 
    { 
        eArgs.EOF = true; 
    } 
    //Item is the default property for Fields 
    System.Windows.Forms.MessageBox.Show (this.Fields["Description"].Value.ToString()); 
}

[Visual Basic] 

Private Sub rptUnboundGrp_FetchData(ByVal sender As Object, ByVal eArgs As DataDynamics.ActiveReports.ActiveReport. _
    FetchEventArgs) Handles MyBase.FetchData
  Try m_reader.Read()
    Me.Fields("CategoryID").Value = m_reader("categories.CategoryID")
    Me.Fields("CategoryName").Value = m_reader("CategoryName")
    Me.Fields("ProductName").Value = m_reader("ProductName")
    Me.Fields("UnitsInStock").Value = m_reader("UnitsInStock")
    Me.Fields("Description").Value = m_reader("Description")
    Me.Fields("TotalLabel").Value = "Total Number of " + m_reader("CategoryName") + ":"
    eArgs.EOF = False
  Catch ex As Exception
    System.Windows.Forms.MessageBox.Show(ex.ToString())
    eArgs.EOF = True
  End Try
  MsgBox(Me.Fields.Item("Description").Value.ToString)
End Sub

See Also

FieldCollection Class  | FieldCollection Members  | Overload List

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.