GraphicObject Class
Base class providing generic properties for various kinds of graphic objects.
Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
Syntax
'Declaration
Public Class GraphicObject
Inherits ReportObject
Implements IDisposable
public class GraphicObject : ReportObject, IDisposable
Example
This example updates the properties of a graphic object.
'Declaration
Private Sub UpdateGraphicObjectProperties(ByVal myReportDocument As ReportDocument, ByVal graphicObjectName As String, ByVal top As Integer, ByVal left As Integer, ByVal height As Integer, ByVal width As Integer)
Dim myReportObject As ReportObject = myReportDocument.ReportDefinition.ReportObjects.Item(graphicObjectName)
If Not myReportObject Is Nothing And TypeOf (myReportObject) Is GraphicObject Then
Dim myGraphicObject As GraphicObject = myReportObject
myGraphicObject.Top = top
myGraphicObject.Left = left
myGraphicObject.Height = height
myGraphicObject.Width = width
Dim myBorder As Border = myGraphicObject.Border()
myBorder.BackgroundColor = Color.White
myBorder.BorderColor = Color.Red
Dim myObjectFormat As ObjectFormat = myGraphicObject.ObjectFormat
myObjectFormat.EnableCanGrow = False
myObjectFormat.EnableSuppress = False
myObjectFormat.EnableCloseAtPageBreak = True
myObjectFormat.EnableKeepTogether = True
End If
End Sub
private void UpdateGraphicObjectProperties(ReportDocument reportDocument, String graphicObjectName, int top, int left, int height, int width)
{
ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[graphicObjectName];
if (reportObject != null && reportObject is GraphicObject)
{
GraphicObject graphicObject = (GraphicObject)reportObject;
graphicObject.Top = top;
graphicObject.Left = left;
graphicObject.Height = height;
graphicObject.Width = width;
Border border = graphicObject.Border;
border.BackgroundColor = Color.White;
border.BorderColor = Color.Red;
ObjectFormat objectFormat = graphicObject.ObjectFormat;
objectFormat.EnableCanGrow = false;
objectFormat.EnableSuppress = false;
objectFormat.EnableCloseAtPageBreak = true;
objectFormat.EnableKeepTogether = true;
}
}
Inheritance Hierarchy
Object
EngineObjectBase
ReportObject
GraphicObject
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports for Visual Studio .NET 2002
See Also
Reference
GraphicObject Members
CrystalDecisions.CrystalReports.Engine Namespace