Share via


DrawingObject Class

Base class providing generic properties for various kinds of drawing objects.

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

Syntax

'Declaration
Public MustInherit Class DrawingObject
    Inherits ReportObject
    Implements IDisposable
public abstract class DrawingObject : ReportObject, IDisposable

Example

This example updates the properties of the DrawingObject object.

'Declaration

          Private Sub UpdateDrawingObjectProperties(ByVal myReportDocument As ReportDocument, ByVal drawingObjectName As String, ByVal top As Integer, ByVal left As Integer)
            Dim myReportObject As ReportObject = myReportDocument.ReportDefinition.ReportObjects.Item(drawingObjectName)
            If Not myReportObject Is Nothing And TypeOf (myReportObject) Is DrawingObject Then
              Dim myDrawingObject As DrawingObject = myReportObject
              myDrawingObject.Top = top
              myDrawingObject.Left = left
              myDrawingObject.EnableExtendToBottomOfSection = True

              myDrawingObject.LineColor = Color.Red
              myDrawingObject.LineStyle = LineStyle.SingleLine
              myDrawingObject.LineThickness = 5

              Dim myBorder As Border = myDrawingObject.Border()
              myBorder.BackgroundColor = Color.White
              myBorder.BorderColor = Color.Red

              Dim myObjectFormat As ObjectFormat = myDrawingObject.ObjectFormat
              myObjectFormat.EnableCanGrow = False
              myObjectFormat.EnableSuppress = False
              myObjectFormat.EnableCloseAtPageBreak = True
              myObjectFormat.EnableKeepTogether = True
            End If
          End Sub
          
          private void UpdateDrawingObjectProperties(ReportDocument reportDocument, String drawingObjectName, int top, int left, int height, int width)
          {
            ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[drawingObjectName];
            if (reportObject != null && reportObject is DrawingObject)
            {
              DrawingObject drawingObject = (DrawingObject)reportObject;
              drawingObject.Top = top;
              drawingObject.Left = left;
              drawingObject.EnableExtendToBottomOfSection = true;

              drawingObject.LineColor = Color.Red;
              drawingObject.LineStyle = LineStyle.SingleLine;
              drawingObject.LineThickness = 5;

              Border border = drawingObject.Border;
              border.BackgroundColor = Color.White;
              border.BorderColor = Color.Red;

              ObjectFormat objectFormat = drawingObject.ObjectFormat;
              objectFormat.EnableCanGrow = false;
              objectFormat.EnableSuppress = false;
              objectFormat.EnableCloseAtPageBreak = true;
              objectFormat.EnableKeepTogether = true;
            }
          }
          

Inheritance Hierarchy

Object
   EngineObjectBase
      ReportObject
         DrawingObject

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

DrawingObject Members
CrystalDecisions.CrystalReports.Engine Namespace