ReportObject Class
Base class providing generic properties for various kinds of report objects.
Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
Syntax
'Declaration
Public Class ReportObject
Inherits EngineObjectBase
Implements IDisposable
public class ReportObject : EngineObjectBase, IDisposable
Remarks
Retrieve the ReportObject object by index or by name through the Item Property of the ReportObjects collection.
Example
This example gets the specified ReportObject object using its name as an index and then updates the properties of the object.
'Declaration
Private Sub UpdateReportObjectProperties(ByVal myReportDocument As ReportDocument, ByVal reportObjectName 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(reportObjectName)
If Not myReportObject Is Nothing Then
myReportObject.Top = top
myReportObject.Left = left
myReportObject.Height = height
myReportObject.Width = width
Dim myBorder As Border = myReportObject.Border()
myBorder.BackgroundColor = Color.White
myBorder.BorderColor = Color.Red
Dim myObjectFormat As ObjectFormat = myReportObject.ObjectFormat
myObjectFormat.EnableCanGrow = False
myObjectFormat.EnableSuppress = False
myObjectFormat.EnableCloseAtPageBreak = True
myObjectFormat.EnableKeepTogether = True
End If
End Sub
ReportObject* GetReportObject(String* reportObjectName)
{
ReportObject* reportObject;
reportObject = Report->ReportDefinition->
ReportObjects->Item[reportObjectName]);
return reportObject;
};
private void UpdateReportObjectProperties(ReportDocument reportDocument, String reportObjectName, int top, int left, int height, int width)
{
ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[reportObjectName];
if (reportObject != null)
{
reportObject.Top = top;
reportObject.Left = left;
reportObject.Height = height;
reportObject.Width = width;
Border border = reportObject.Border;
border.BackgroundColor = Color.White;
border.BorderColor = Color.Red;
ObjectFormat objectFormat = reportObject.ObjectFormat;
objectFormat.EnableCanGrow = false;
objectFormat.EnableSuppress = false;
objectFormat.EnableCloseAtPageBreak = true;
objectFormat.EnableKeepTogether = true;
}
}
Inheritance Hierarchy
Object
EngineObjectBase
ReportObject
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports for Visual Studio .NET 2002
See Also
Reference
ReportObject Members
CrystalDecisions.CrystalReports.Engine Namespace