ReportObjects.Item Property

Gets the object with the specified name. In C#, this property is the indexer for the ReportObject class.

Overload List

Description
ReportObjects.Item Property (String) Gets the object with the specified name. In C#, this property is the indexer for the ReportObject class.
ReportObjects.Item Property (Integer) Gets the object at the specified index. In C#, this property is the indexer for the ReportObject class.

Example

This example shows how to set the border line styles to a single style, update the background and border colors, and change the drop shadow setting.

'Declaration

  Private Sub UpdateBlobFieldObjectBorder(ByVal myReportDocument As ReportDocument, ByVal reportObjectName As String, ByVal myLineStyle As LineStyle, ByVal backgroundColor As Color, ByVal borderColor As Color)
    Dim myReportObject As ReportObject = myReportDocument.ReportDefinition.ReportObjects.Item(reportObjectName)
    If myReportObject.Kind = ReportObjectKind.BlobFieldObject Then
      Dim myBlobFieldObject As BlobFieldObject = myReportObject
      Dim myBorder As Border = myBlobFieldObject.Border
      myBorder.BackgroundColor = backgroundColor
      myBorder.BorderColor = borderColor
      myBorder.BottomLineStyle = myLineStyle
      myBorder.LeftLineStyle = myLineStyle
      myBorder.RightLineStyle = myLineStyle
      myBorder.TopLineStyle = myLineStyle
      myBorder.HasDropShadow = True
    End If
  End Sub
  private void UpdateBlobFieldObjectBorder(ReportDocument reportDocument, String reportObjectName, LineStyle lineStyle, Color backgroundColor, Color borderColor)
  {
    ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[reportObjectName];
    if (reportObject.Kind == ReportObjectKind.BlobFieldObject)
    {
      BlobFieldObject blobFieldObject = (BlobFieldObject)reportObject;
      Border border = blobFieldObject.Border;

      border.BackgroundColor = backgroundColor;
      border.BorderColor = borderColor;
      border.BottomLineStyle = lineStyle;
      border.LeftLineStyle = lineStyle;
      border.RightLineStyle = lineStyle;
      border.TopLineStyle = lineStyle;
      border.HasDropShadow = false;
    }
  }

See Also

Reference

ReportObjects Class
ReportObjects Members
CrystalDecisions.CrystalReports.Engine Namespace