Share via


Areas.Count Property

Gets the number of Area objects in the collection.

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

Syntax

'Declaration

Public Overrides ReadOnly Property Count As Integer
public override int Count {get;}

Property Value

The number of items in the collection.

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 .NET 10

See Also

Reference

Areas Class
Areas Members
CrystalDecisions.CrystalReports.Engine Namespace