GroupNameFieldDefinitions.Item Property (Integer)

Gets the object at the specified index. In C#, this property is the indexer for the GroupNameFieldDefinition class.

Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

Syntax

'Declaration

Public Overrideable ReadOnly Property Item ( _
    ByVal index As Integer _    
) As CrystalDecisions.CrystalReports.Engine.GroupNameFieldDefinition
public virtual CrystalDecisions.CrystalReports.Engine.GroupNameFieldDefinition this [
    int index
]{get;}

Parameters

  • index

Property Value

The value in the collection at the specified index.

Remarks

This property allows you to access a specific item in the collection. The item is referenced using a numeric, zero-based index.

The property name Item does not exist for C#. To access an item in a collection using C#, use the syntax: collection[0].

Example

This example searches for the group name field definition by partial name.

'Declaration

      Private Function GetGroupNameFieldDefinitionByPartialName(ByVal myReportDocument As ReportDocument, ByVal partialFieldName As String) As GroupNameFieldDefinition
        GetGroupNameFieldDefinitionByPartialName = Nothing
        Dim myGroupNameFieldDefinitions As GroupNameFieldDefinitions = myReportDocument.DataDefinition.GroupNameFields
        Dim i As Integer
        For i = 0 To myGroupNameFieldDefinitions.Count
          Dim myGroupNameFieldDefinition As GroupNameFieldDefinition
          myGroupNameFieldDefinition = myGroupNameFieldDefinitions.Item(i)
          If InStr(myGroupNameFieldDefinition.Name, partialFieldName) > 0 Then
            GetGroupNameFieldDefinitionByPartialName = myGroupNameFieldDefinition
            Exit Function
          End If
        Next
      End Function
      
      private GroupNameFieldDefinition GetGroupNameFieldDefinitionByPartialName(ReportDocument reportDocument, String partialFieldName)
      {
        GroupNameFieldDefinitions groupNameFieldDefinitions = reportDocument.DataDefinition.GroupNameFields;

        for (int i=0; i< groupNameFieldDefinitions.Count; i++)
        {
          GroupNameFieldDefinition groupNameFieldDefinition = groupNameFieldDefinitions[i];

          if (groupNameFieldDefinition.Name.IndexOf(partialFieldName) >= 0)
          {
            return groupNameFieldDefinition;
          }
        }
        return null;
      }
      

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

GroupNameFieldDefinitions Class
GroupNameFieldDefinitions Members
CrystalDecisions.CrystalReports.Engine Namespace