MapObject Class
Represents a geographic map object on the report.
Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
Syntax
'Declaration
Public Class MapObject
Inherits ReportObject
Implements IDisposable
public class MapObject : ReportObject, IDisposable
Remarks
This class allows you to retrieve information and set generic format options inherited from the ReportObject class.
Map objects are not supported in this version of Crystal Reports. Map objects will appear blank in the report.
Example
This example updates the properties of a MapObject object.
'Declaration
Private Sub UpdateMapObjectProperties(ByVal myReportDocument As ReportDocument, ByVal mapObjectName 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(mapObjectName)
If Not myReportObject Is Nothing And myReportObject.Kind = ReportObjectKind.MapObject Then
Dim myMapObject As MapObject = myReportObject
myMapObject.Top = top
myMapObject.Left = left
myMapObject.Height = height
myMapObject.Width = width
Dim myBorder As Border = myMapObject.Border()
myBorder.BackgroundColor = Color.White
myBorder.BorderColor = Color.Red
Dim myObjectFormat As ObjectFormat = myMapObject.ObjectFormat
myObjectFormat.EnableCanGrow = False
myObjectFormat.EnableSuppress = False
myObjectFormat.EnableCloseAtPageBreak = True
myObjectFormat.EnableKeepTogether = True
End If
End Sub
private void UpdateMapObjectProperties(ReportDocument reportDocument, String mapObjectName, int top, int left, int height, int width)
{
ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects[mapObjectName];
if (reportObject != null && reportObject.Kind == ReportObjectKind.MapObject)
{
MapObject mapObject = (MapObject)reportObject;
mapObject.Top = top;
mapObject.Left = left;
mapObject.Height = height;
mapObject.Width = width;
Border border = mapObject.Border;
border.BackgroundColor = Color.White;
border.BorderColor = Color.Red;
ObjectFormat objectFormat = mapObject.ObjectFormat;
objectFormat.EnableCanGrow = false;
objectFormat.EnableSuppress = false;
objectFormat.EnableCloseAtPageBreak = true;
objectFormat.EnableKeepTogether = true;
}
}
Inheritance Hierarchy
Object
EngineObjectBase
ReportObject
MapObject
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports for Visual Studio .NET 2002
See Also
Reference
MapObject Members
CrystalDecisions.CrystalReports.Engine Namespace