Dashboard DataSet Business Rule Examples

Map Dashboard Component Business Rule Examples

The Map Component is used to display specific locations on a geographical map via a Dashboard DataSet Business Rule.  The XFMapItemCollection objects provide the ability to pass in Parameters in order to drill down on these locations and display data. 

Pinpoint Example

This places a clickable pinpoint at each geographical location.  A Parameter value can be included in the string in order to generate an action upon clicking the pinpoint.

The string defines the following:
(Latitude, Longitude, Location Label, Image to display on map, latitude pixel shift (if necessary), longitude pixel shift (if necessary), Parameter Value, Image to display when hovering over the location)

Dim pinPoints As New List(Of XFMapPinPoint)
pinPoints.Add(New XFMapPinPoint(42.68342, -83.13702, "Rochester", XFImageFileSourceType.ClientImage, "StatusGreenBall",
   0, 0, "Clubs", XFImageFileSourceType.ClientImage, "StatusRedBall"))

NOTE: See Business Rule Client Image Types for a list of available status images.

Result:


Ellipses Example

This places a clickable ellipse at each geographical location.  A Parameter value can be included in the string in order to generate an action upon clicking the ellipsis.

The string defines the following:
(Latitude, Longitude, ellipse width, ellipse height, ellipse color, opacity, stroke color (border), stroke thickness, Parameter Value, color when hovering over the ellipse, hover opacity, hover stroke, hover stroke thickness)

Dim ellipses As New List(Of XFMapEllipse)
ellipses.Add(New XFMapEllipse(50.5, .5, 4, 2, XFColors.Yellow.GetHexString(), .5,
   XFColors.Red.GetHexString(), 2,"ellipseParam1", XFColors.Green.GetHexString(),
   1,XFColors.Blue.GetHexString(), 4))

Result:

Polylines Example

This creates a continuous line composed of several pre-determined line segments.

First define the coordinates for each polyline segment.  The string then defines the following:
(Polyline name, reference to the local variables above, line color, line thickness, Parameter Value, hover color, hover thickness)

Dim polylines As New List(Of XFMapPolyline)
Dim points As New List(Of XFMapPoint)
points.Add(New XFMapPoint(20, 20))
points.Add(New XFMapPoint(30, 25))
points.Add(New XFMapPoint(40, 15))
polylines.Add(New XFMapPolyline("Polyline1", points, XFColors.Black.GetHexString(), 3,
"polylineParam1", XFColors.Green.GetHexString(), 6))

Polygons Example

This creates a polygon shape which outlines a specific location on the map.

First define the coordinates to apply to the polygon.  The string defines the following:
(Polygon name, reference to the local variables above, polygon color, opacity, stroke, stroke thickness, Parameter Value, hover color, hover opacity, hover stroke, hover stroke thickness)

Dim texasPoints As New List(Of XFMapPoint)
texasPoints.Add(New XFMapPoint(36.29, -103.2))
texasPoints.Add(New XFMapPoint(36.29, -100))
texasPoints.Add(New XFMapPoint(34.33, -100))
texasPoints.Add(New XFMapPoint(33.33, -94.2))
texasPoints.Add(New XFMapPoint(29.41, -93.5))
texasPoints.Add(New XFMapPoint(25.57, -97.8))
texasPoints.Add(New XFMapPoint(29.45, -101.24))
texasPoints.Add(New XFMapPoint(28.58, -103.9))
texasPoints.Add(New XFMapPoint(32, -106.37))
texasPoints.Add(New XFMapPoint(32, -103.2))
polygons.Add(New XFMapPolygon("Texas", texasPoints, XFColors.white.GetHexString(), 0,
XFColors.Red.GetHexString(), 5, "Texas", String.Empty, 0, XFColors.Blue.GetHexString(), 5))

Result:

Gantt Dashboard Component Business Rule Example

This Dashboard Data Set Business Rule demonstrates how to create a hard-coded list of tasks to display in a Gantt View Control.

If args.DataSetName.XFEqualsIgnoreCase("GanttDataSet") Then
    'Create a DataSet from the XFGanttTaskCollection
    '----------------------------------------------------------------------------
   'Define the properties that we need to set for each task
    Dim now As DateTime = DateTime.UtcNow
    Dim taskName As String = String.Empty
     Dim taskTitle As String = String.Empty
     Dim taskDesc As String = String.Empty
     Dim wfStatusType As WorkflowStatusTypes = WorkflowStatusTypes.Unknown
     Dim imageSource As XFImageFileSourceType = XFImageFileSourceType.ClientImage
     Dim imageNameOrPath As String = ""
     Dim taskStartTime As DateTime = now
     Dim taskEndTime As DateTime = now.AddDays(2)
     Dim taskDeadline As DateTime = now.AddDays(5)
     Dim isMilestone As Boolean = False
     Dim percentComplete As Double = 0
     Dim isHighlighted As Boolean  = False
     Dim taskParameters As String = String.Empty
     Dim dependencies As New List(Of String)
     Dim children As New List(Of XFGanttTaskItem)
 
   'Create Task 1
    taskName = "MyTask1"
    taskTitle = "MyTask1 Title"
    taskDesc = "MyTask1 Description"
    wfStatusType = WorkflowStatusTypes.Unknown
    imageSource = XFImageFileSourceType.ClientImage
    imageNameOrPath = XFClientImageTypes.StatusGrayBall.Name
    taskStartTime = now
    taskEndTime = now.AddDays(3)
     taskDeadline = now.AddDays(6)
     isMilestone = False
     percentComplete = 25
     isHighlighted = False
     taskParameters = "MyParam=HiTask1"
     dependencies = New List(Of String)
     children = New List(Of XFGanttTaskItem)                            
    Dim task1 As New XFGanttTaskItem(taskName, taskTitle, taskDesc, wfStatusType, imageSource,
    imageNameOrPath, taskStartTime, taskEndTime, taskDeadline, isMilestone, percentComplete,
    isHighlighted, taskParameters, children, dependencies)