Areas.Item Property (Integer)

Gets the object at the specified index. In C#, this property is the indexer for the Areas 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.Area
public virtual CrystalDecisions.CrystalReports.Engine.Area 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 shows how to hide an area in a ReportDocument according to the Area.Name property.

'Declaration

  Private Sub HideAreaByName(ByVal myReportDocument As ReportDocument, ByVal areaName As String)
    Dim myReportDefinition As ReportDefinition
    myReportDefinition = myReportDocument.ReportDefinition()

    Dim myAreas As Areas
    myAreas = myReportDefinition.Areas()

    Dim i As Integer
    For i = 0 To myAreas.Count
      Dim myArea As Area
      myArea = myAreas.Item(i)
      If myArea.Name = areaName Then
        Dim myAreaFormat As AreaFormat = myArea.AreaFormat
        myAreaFormat.EnableHideForDrillDown = True
      End If
    Next
  End Sub
  private void HideAreaByName(ReportDocument reportDocument, String areaName)
  {
    ReportDefinition myReportDefinition = reportDocument.ReportDefinition;
    Areas areas = myReportDefinition.Areas;

    for (int i=0; i<areas.Count; i++)
    {
      Area area = areas[i];
      if (area.Name == areaName)
      {
        AreaFormat areaFormat = area.AreaFormat;
        areaFormat.EnableHideForDrillDown = true;
      }
    }
  }

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

Areas Class
Areas Members
CrystalDecisions.CrystalReports.Engine Namespace