Search Results for

    Show / Hide Table of Contents

    Class MapObject

    Represents a map object.

    Inheritance
    System.Object
    Base
    ComponentBase
    ReportComponentBase
    MapObject
    Implements
    IFRSerializable
    IHasEditor
    IParent
    Inherited Members
    ReportComponentBase.BeforePrint
    ReportComponentBase.AfterPrint
    ReportComponentBase.AfterData
    ReportComponentBase.Click
    ReportComponentBase.Exportable
    ReportComponentBase.ExportableExpression
    ReportComponentBase.Border
    ReportComponentBase.Fill
    ReportComponentBase.FillColor
    ReportComponentBase.Bookmark
    ReportComponentBase.Hyperlink
    ReportComponentBase.GrowToBottom
    ReportComponentBase.ShiftMode
    ReportComponentBase.PageBreak
    ReportComponentBase.PrintOn
    ReportComponentBase.BeforePrintEvent
    ReportComponentBase.AfterPrintEvent
    ReportComponentBase.AfterDataEvent
    ReportComponentBase.ClickEvent
    ReportComponentBase.FlagSimpleBorder
    ReportComponentBase.FlagUseBorder
    ReportComponentBase.FlagUseFill
    ReportComponentBase.FlagPreviewVisible
    ReportComponentBase.FlagSerializeStyle
    ReportComponentBase.FlagProvidesHyperlinkValue
    ReportComponentBase.IsCompilationNeeded
    ReportComponentBase.Cursor
    ReportComponentBase.MouseMoveEvent
    ReportComponentBase.MouseUpEvent
    ReportComponentBase.MouseDownEvent
    ReportComponentBase.MouseEnterEvent
    ReportComponentBase.MouseLeaveEvent
    ReportComponentBase.ApplyStyle(Style)
    ReportComponentBase.SaveStyle()
    ReportComponentBase.RestoreStyle()
    ReportComponentBase.DrawBackground(FRPaintEventArgs)
    ReportComponentBase.IsVisible(FRPaintEventArgs)
    ReportComponentBase.Validate()
    ReportComponentBase.Deserialize(FRReader)
    ReportComponentBase.OnClick(EventArgs)
    ReportComponentBase.OnAfterLoad()
    ReportComponentBase.HasClickListeners()
    ReportComponentBase.ResetData()
    ReportComponentBase.CalcHeight()
    ReportComponentBase.GetExpressions()
    ReportComponentBase.OnBeforePrint(EventArgs)
    ReportComponentBase.OnAfterPrint(EventArgs)
    ReportComponentBase.OnAfterData(EventArgs)
    FastReport.ReportComponentBase.Left
    FastReport.ReportComponentBase.Top
    FastReport.ReportComponentBase.Width
    FastReport.ReportComponentBase.Height
    FastReport.ReportComponentBase.AssignFormat(FastReport.ReportComponentBase)
    FastReport.ReportComponentBase.CheckParent(System.Boolean)
    FastReport.ReportComponentBase.DrawMarkers(FastReport.Utils.FRPaintEventArgs)
    FastReport.ReportComponentBase.DrawMarkers(FastReport.Utils.FRPaintEventArgs, FastReport.MarkerStyle)
    FastReport.ReportComponentBase.DrawIntersection(FastReport.Utils.FRPaintEventArgs)
    FastReport.ReportComponentBase.GetContextMenu()
    FastReport.ReportComponentBase.OnAfterInsert(FastReport.InsertFrom)
    FastReport.ReportComponentBase.MouseMove
    FastReport.ReportComponentBase.MouseUp
    FastReport.ReportComponentBase.MouseDown
    FastReport.ReportComponentBase.MouseEnter
    FastReport.ReportComponentBase.MouseLeave
    FastReport.ReportComponentBase.AssignPreviewEvents(FastReport.Base)
    FastReport.ReportComponentBase.GetPreviewContextMenu()
    ComponentBase.AbsBottom
    ComponentBase.AbsBounds
    ComponentBase.AbsLeft
    ComponentBase.AbsRight
    ComponentBase.AbsTop
    ComponentBase.Anchor
    ComponentBase.Bottom
    ComponentBase.Bounds
    ComponentBase.ClientSize
    ComponentBase.Dock
    ComponentBase.GroupIndex
    ComponentBase.Right
    ComponentBase.Tag
    ComponentBase.Visible
    ComponentBase.VisibleExpression
    ComponentBase.Printable
    ComponentBase.PrintableExpression
    ComponentBase.CalcVisibleExpression(String)
    FastReport.ComponentBase.CheckNegativeSize(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.DrawDragAcceptFrame(FastReport.Utils.FRPaintEventArgs, System.Drawing.Color)
    FastReport.ComponentBase.DrawSelection(FastReport.Utils.FRPaintEventArgs)
    FastReport.ComponentBase.GetSmartTag()
    FastReport.ComponentBase.HandleDoubleClick()
    FastReport.ComponentBase.HandleDragDrop(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleDragOver(FastReport.Utils.FRMouseEventArgs)
    FastReport.ComponentBase.HandleKeyDown(System.Windows.Forms.Control, System.Windows.Forms.KeyEventArgs)
    FastReport.ComponentBase.PointInObject(System.Drawing.PointF)
    FastReport.ComponentBase.DrawSelectionPoint(FastReport.Utils.FRPaintEventArgs, System.Drawing.Pen, System.Drawing.Brush, System.Single, System.Single)
    FastReport.ComponentBase.GetSelectionPoints()
    FastReport.ComponentBase.PointInSelectionPoint(System.Single, System.Single, System.Drawing.PointF)
    Base.Name
    Base.Restrictions
    Base.Flags
    Base.Parent
    Base.BaseName
    Base.ClassName
    Base.Report
    Base.Page
    Base.ChildObjects
    Base.AllObjects
    Base.ZOrder
    Base.IsAncestor
    Base.IsDesigning
    Base.IsPrinting
    Base.IsRunning
    Base.OriginalComponent
    Base.Disposed
    Base.SetProp(Base, Base)
    Base.FloatDiff(Single, Single)
    Base.DeserializeSubItems(FRReader)
    Base.ExtractDefaultMacros(String)
    Base.Dispose(Boolean)
    Base.Dispose()
    Base.SetFlags(Flags, Boolean)
    Base.SetReport(Report)
    Base.SetName(String)
    Base.SetParent(Base)
    Base.SetParentCore(Base)
    Base.FindObject(String)
    Base.CreateUniqueName()
    Base.Clear()
    Base.BaseAssign(Base)
    Base.AssignAll(Base)
    Base.HasParent(Base)
    Base.HasFlag(Flags)
    Base.HasRestriction(Restrictions)
    Base.InvokeEvent(String, Object)
    Base.GetCustomScript()
    Base.ExtractMacros()
    Base.IsHaveToConvert(Object)
    Base.GetConvertedObjects()
    Base.ForEachAllConvectedObjects(Object)
    FastReport.Base.IsParentSelected
    FastReport.Base.Delete()
    FastReport.Base.SelectionChanged()
    FastReport.Base.GetImageIndex()
    Namespace: FastReport.Map
    Assembly: FastReport.dll
    Syntax
    public class MapObject : ReportComponentBase, IDisposable, IFRSerializable, IHasEditor, IParent

    Constructors

    MapObject()

    Initializes a new instance of the MapObject class.

    Declaration
    public MapObject()

    Fields

    ShapefileFolder

    Gets or sets the path to folder containing shapefiles.

    Declaration
    public static string ShapefileFolder
    Field Value
    Type Description
    System.String
    Remarks

    This property is used by the map editor when selecting a shapefile.

    Properties

    CanGrow

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public bool CanGrow { get; set; }
    Property Value
    Type Description
    System.Boolean

    CanShrink

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public bool CanShrink { get; set; }
    Property Value
    Type Description
    System.Boolean

    ColorScale

    Gets the color scale settings.

    Declaration
    public ColorScale ColorScale { get; }
    Property Value
    Type Description
    ColorScale

    EvenStyle

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public string EvenStyle { get; set; }
    Property Value
    Type Description
    System.String

    EvenStylePriority

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public StylePriority EvenStylePriority { get; set; }
    Property Value
    Type Description
    StylePriority

    HoverStyle

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public string HoverStyle { get; set; }
    Property Value
    Type Description
    System.String

    IsSelected

    Gets a value indicating whether the object is selected in the designer.

    Declaration
    public override bool IsSelected { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    FastReport.Base.IsSelected

    Layers

    Gets or sets a collection of map layers.

    Declaration
    [Browsable(false)]
    public LayerCollection Layers { get; set; }
    Property Value
    Type Description
    LayerCollection

    MaxZoom

    Gets or sets maximum zoom value.

    Declaration
    public float MaxZoom { get; set; }
    Property Value
    Type Description
    System.Single

    MercatorProjection

    Gets or sets the value indicating that mercator projection must be used to view the map.

    Declaration
    public bool MercatorProjection { get; set; }
    Property Value
    Type Description
    System.Boolean

    MinZoom

    Gets or sets minimum zoom value.

    Declaration
    public float MinZoom { get; set; }
    Property Value
    Type Description
    System.Single

    OffsetX

    Gets or sets the X offset of the map.

    Declaration
    public float OffsetX { get; set; }
    Property Value
    Type Description
    System.Single

    OffsetY

    Gets or sets the Y offset of the map.

    Declaration
    public float OffsetY { get; set; }
    Property Value
    Type Description
    System.Single

    Padding

    Gets or sets padding within the map.

    Declaration
    public Padding Padding { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.Padding

    Style

    This property is not relevant to this class.

    Declaration
    [Browsable(false)]
    public string Style { get; set; }
    Property Value
    Type Description
    System.String

    Zoom

    Gets or sets the map zoom.

    Declaration
    public float Zoom { get; set; }
    Property Value
    Type Description
    System.Single

    Methods

    AddChild(Base)

    Adds a child object to this object's childs.

    Declaration
    public void AddChild(Base child)
    Parameters
    Type Name Description
    Base child

    Object to add.

    Assign(Base)

    Copies the contents of another, similar object.

    Declaration
    public override void Assign(Base source)
    Parameters
    Type Name Description
    Base source

    Source object to copy the contents from.

    Overrides
    ReportComponentBase.Assign(Base)
    Remarks

    Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is

    destination.Assign(source);

    which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.

    See Also
    AssignAll(Base)

    CanContain(Base)

    Gets a value indicating that this object can contain the specified child object.

    Declaration
    public bool CanContain(Base child)
    Parameters
    Type Name Description
    Base child

    Child object.

    Returns
    Type Description
    System.Boolean

    true if this object can contain the specified child object; otherwise, false.

    CreateUniqueNames()

    Creates unique names for all contained objects such as layers, shapes, etc.

    Declaration
    public void CreateUniqueNames()

    Draw(FRPaintEventArgs)

    Declaration
    public override void Draw(FRPaintEventArgs e)
    Parameters
    Type Name Description
    FRPaintEventArgs e
    Overrides
    ReportComponentBase.Draw(FRPaintEventArgs)

    FinalizeComponent()

    Performs a finalization after the report is finished.

    Declaration
    public override void FinalizeComponent()
    Overrides
    ReportComponentBase.FinalizeComponent()
    Remarks

    This method is used by the report engine, do not call it directly.

    GetChildObjects(ObjectCollection)

    Gets a list of child objects.

    Declaration
    public void GetChildObjects(ObjectCollection list)
    Parameters
    Type Name Description
    ObjectCollection list

    List to fill with values.

    GetChildOrder(Base)

    Returns z-order of the specified child object.

    Declaration
    public int GetChildOrder(Base child)
    Parameters
    Type Name Description
    Base child

    Child object.

    Returns
    Type Description
    System.Int32

    Z-order of the specified object.

    Remarks

    This method must return the index of a specified child object in the internal child list.

    GetData()

    Gets the data from a datasource that the object is connected to.

    Declaration
    public override void GetData()
    Overrides
    ReportComponentBase.GetData()
    Remarks

    This method is called by the report engine before processing the object.

    Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should get the data from a datasource that the object is connected to.

    GetDataAsync(CancellationToken)

    Declaration
    public override async Task GetDataAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task
    Overrides
    ReportComponentBase.GetDataAsync(CancellationToken)

    GetPreferredSize()

    Gets the preferred size of an object.

    Declaration
    public override SizeF GetPreferredSize()
    Returns
    Type Description
    System.Drawing.SizeF

    Preferred size.

    Overrides
    FastReport.ReportComponentBase.GetPreferredSize()
    Remarks

    This method is called by the FastReport designer when you insert a new object.

    HandleMouseDown(FRMouseEventArgs)

    Handles MouseDown event that occurs when the user clicks the mouse in the designer.

    Declaration
    public override void HandleMouseDown(FRMouseEventArgs e)
    Parameters
    Type Name Description
    FRMouseEventArgs e

    Current mouse state.

    Overrides
    FastReport.ReportComponentBase.HandleMouseDown(FastReport.Utils.FRMouseEventArgs)
    Remarks

    This method is called when the user press the mouse button in the designer. The standard implementation does the following:

    • checks if the mouse pointer is inside the object;
    • add an object to the selected objects list of the designer;
    • sets the e.Handled flag to true.

    HandleMouseHover(FRMouseEventArgs)

    Handles MouseMove event that occurs when the user moves the mouse in the designer.

    Declaration
    public override void HandleMouseHover(FRMouseEventArgs e)
    Parameters
    Type Name Description
    FRMouseEventArgs e

    Current mouse state.

    Overrides
    FastReport.ComponentBase.HandleMouseHover(FastReport.Utils.FRMouseEventArgs)
    Remarks

    This method is called when the user moves the mouse in the designer. Typical use of this method is to change the mouse cursor to SizeAll when it is over an object. The standard implementation does the following:

    • checks if the mouse pointer is inside the object;
    • changes the cursor shape (e.Cursor property);
    • sets the e.Handled flag to true.

    HandleMouseMove(FRMouseEventArgs)

    Handles MouseMove event that occurs when the user moves the mouse in the designer.

    Declaration
    public override void HandleMouseMove(FRMouseEventArgs e)
    Parameters
    Type Name Description
    FRMouseEventArgs e

    Current mouse state.

    Overrides
    FastReport.ComponentBase.HandleMouseMove(FastReport.Utils.FRMouseEventArgs)
    Remarks

    This method is called when the user moves the mouse in the designer. The standard implementation does the following:

    • if mouse button is not pressed, check that mouse pointer is inside one of the selection points returned by the FastReport.ComponentBase.GetSelectionPoints() method and set the e.SizingPoint member to the corresponding sizing point;
    • if mouse button is pressed, and e.SizingPoint member is not SizingPoint.None, resize the object.

    HandleMouseUp(FRMouseEventArgs)

    Handles MouseUp event that occurs when the user releases the mouse button in the designer.

    Declaration
    public override void HandleMouseUp(FRMouseEventArgs e)
    Parameters
    Type Name Description
    FRMouseEventArgs e

    Current mouse state.

    Overrides
    FastReport.ComponentBase.HandleMouseUp(FastReport.Utils.FRMouseEventArgs)
    Remarks

    This method is called when the user releases the mouse button in the designer. The standard implementation does the following:

    • if e.Mode is WorkspaceMode2.SelectionRect, checks if object is inside the selection rectangle and sets e.Handled flag if so;
    • checks that object is inside its parent (calls the FastReport.ComponentBase.CheckParent(System.Boolean) method).

    HandleMouseWheel(FRMouseEventArgs)

    Handles mouse wheel event.

    Declaration
    public override void HandleMouseWheel(FRMouseEventArgs e)
    Parameters
    Type Name Description
    FRMouseEventArgs e

    Current mouse state.

    Overrides
    FastReport.ComponentBase.HandleMouseWheel(FastReport.Utils.FRMouseEventArgs)

    InitializeComponent()

    Initializes the object before running a report.

    Declaration
    public override void InitializeComponent()
    Overrides
    ReportComponentBase.InitializeComponent()
    Remarks

    This method is used by the report engine, do not call it directly.

    InvokeEditor()

    Invokes the object's editor.

    Declaration
    public bool InvokeEditor()
    Returns
    Type Description
    System.Boolean

    true if object was succesfully edited.

    Remarks

    This method is called by FastReport when the object is doubleclicked in the designer.

    Load(String)

    Loads a map from file.

    Declaration
    public void Load(string filename)
    Parameters
    Type Name Description
    System.String filename

    Name of file that contains a map.

    OnBeforeInsert(Int32)

    Called before inserting a new object in the designer.

    Declaration
    public override void OnBeforeInsert(int flags)
    Parameters
    Type Name Description
    System.Int32 flags

    Object's flags.

    Overrides
    FastReport.Base.OnBeforeInsert(System.Int32)
    Remarks

    Do not call this method directly. You may override it if you are developing a new component for FastReport.

    Some objects are registered in the designer several times with the same object type, but different flags. For example, the ShapeObject represents different shapes: rectangle, roundrect, ellipse and so on. All these shapes are registered in the designer using flags (the last parameter in this code):

    RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 108, "Objects,Shapes,Rectangle", 0);
    RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 109, "Objects,Shapes,RoundRectangle", 1);
    RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 110, "Objects,Shapes,Ellipse", 2);

    When we put the "Ellipse" object on a band, the designer creates the ShapeObject instance and calls its OnBeforeInsert method with flags value set to 2. In turn, the OnBeforeInsert method converts the int value of the flags to the shape kind:

    public override void OnBeforeInsert(int flags)
    {
    FShape = (ShapeKind)flags;
    }

    OnMouseDown(MouseEventArgs)

    This method fires the MouseDown event and the script code connected to the MouseDownEvent.

    Declaration
    public override void OnMouseDown(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    Event data.

    Overrides
    FastReport.ReportComponentBase.OnMouseDown(System.Windows.Forms.MouseEventArgs)

    OnMouseEnter(EventArgs)

    This method fires the MouseEnter event and the script code connected to the MouseEnterEvent.

    Declaration
    public override void OnMouseEnter(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    Event data.

    Overrides
    FastReport.ReportComponentBase.OnMouseEnter(System.EventArgs)

    OnMouseLeave(EventArgs)

    This method fires the MouseLeave event and the script code connected to the MouseLeaveEvent.

    Declaration
    public override void OnMouseLeave(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    Event data.

    Overrides
    FastReport.ReportComponentBase.OnMouseLeave(System.EventArgs)

    OnMouseMove(MouseEventArgs)

    This method fires the MouseMove event and the script code connected to the MouseMoveEvent.

    Declaration
    public override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    Event data.

    Overrides
    FastReport.ReportComponentBase.OnMouseMove(System.Windows.Forms.MouseEventArgs)

    OnMouseUp(MouseEventArgs)

    This method fires the MouseUp event and the script code connected to the MouseUpEvent.

    Declaration
    public override void OnMouseUp(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    Event data.

    Overrides
    FastReport.ReportComponentBase.OnMouseUp(System.Windows.Forms.MouseEventArgs)

    OnMouseWheel(MouseEventArgs)

    This method is fired when the user scrolls the mouse in the preview window.

    Declaration
    public override void OnMouseWheel(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    Event data.

    Overrides
    FastReport.ReportComponentBase.OnMouseWheel(System.Windows.Forms.MouseEventArgs)

    RemoveChild(Base)

    Removes a specified object from this object's childs.

    Declaration
    public void RemoveChild(Base child)
    Parameters
    Type Name Description
    Base child

    RestoreState()

    Restores the object's state after printing it.

    Declaration
    public override void RestoreState()
    Overrides
    ReportComponentBase.RestoreState()
    Remarks

    This method is called by the report engine after processing the object.

    Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should restore the object properties that were saved by the SaveState() method.

    SaveState()

    Saves the object's state before printing it.

    Declaration
    public override void SaveState()
    Overrides
    ReportComponentBase.SaveState()
    Remarks

    This method is called by the report engine before processing the object.

    Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should save any object properties that may be changed during the object printing. The standard implementation saves the object's bounds, visibility, bookmark and hyperlink.

    Serialize(FRWriter)

    Serializes the object.

    Declaration
    public override void Serialize(FRWriter writer)
    Parameters
    Type Name Description
    FRWriter writer

    Writer object.

    Overrides
    ReportComponentBase.Serialize(FRWriter)
    Remarks

    Do not call this method directly. You should override it if you are developing a new component for FastReport.

    This method is called when the object needs to save the state. It may happen when:

    • saving the report to the file or stream;
    • saving the report to the designer's undo buffer;
    • assigning the object to another object using the Assign(Base) or AssignAll methods;
    • saving the object to the designer's clipboard;
    • saving the object to the preview (when run a report).

    SetChildOrder(Base, Int32)

    Sets the z-order of the specified object.

    Declaration
    public void SetChildOrder(Base child, int order)
    Parameters
    Type Name Description
    Base child

    Child object.

    System.Int32 order

    New Z-order.

    Remarks

    This method must place the specified child object at the specified position in the internal child list.

    UpdateLayout(Single, Single)

    Updates the children layout when the size of this object is changed by dx, dy values.

    Declaration
    public void UpdateLayout(float dx, float dy)
    Parameters
    Type Name Description
    System.Single dx

    X delta.

    System.Single dy

    Y delta.

    Remarks

    This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.

    Implements

    IFRSerializable
    IHasEditor
    IParent
    Back to top © 1998-2025 Copyright Fast Reports Inc.