Here is my ruff around the edges code to generate spot on a report with the background as a picture of a map.
The coordinates are GPS, the positions are between the upper left corner and lower right corner of the picture (georeferenced).
What I need to do is loop trough each records to get the values for positioning the circles and text on the map. The data come from a query where the catégories of clients is selected.
Thank you in advance
Private Sub Report_Page()
‘Variables and constants for Circle - (Circle Method)
Const conPI = 3.14159265359
Dim sngHCtr As Single, sngVCtr As Single
Dim sngRadius As Single
Dim sngStart As Single, sngEnd As Single
‘Variables for Text over the circles - (Print method)
Dim rpt as ReportDim strMessage As StringDim intHorSize As Integer, intVerSize As Integer
‘Variables for DAO
‘Variables for Loop
Query = “DataXY “
Fields = [Number],[ColorCode],[dX] and [dY]
Label = [Number] ‘Number that Id the circle
ValColor = [ColorCode] ‘ Value of the color of the circle
X = [dX] ‘Coordinate X (position text on map)
Y = [dY] ‘Coordinate Y (position text on map)
For each record in query
Do While not EOF
‘Draw Circle
sngHCtr = X ' Horizontal position.
sngVCtr = Y ' Vertical position.
sngRadius = Me.ScaleHeight / 100 ' Circle radius.
Me.Circle (sngHCtr, sngVCtr), sngRadius ‘Draw Circle
sngStart = -0.00000001 ' Start of pie slice.
sngEnd = -256 * conPI / 129 ' End of pie slice.
Me.FillColor = ValColor ' Color pie slice.
Me.FillStyle = 0 ' Fill pie slice.
Me.ForeColor = ValColor
' Draw pie slice within circle.
Me.Circle (sngHCtr, sngVCtr), sngRadius, , sngStart, sngEnd
‘Draw Text over circle
Set rpt = Me strMessage = Label With rpt 'Set scale to pixels, and set FontName and 'FontSize properties. .ScaleMode = 3 .FontName = "Courier" .FontSize =6 .ForeColor = ValColor .FontBold = 1 End With ' Horizontal width. intHorSize = Rpt.TextWidth(strMessage) ' Vertical height. intVerSize = Rpt.TextHeight(strMessage) ' Calculate location of text to be displayed. Rpt.CurrentX = X - (intHorSize/2) Rpt.CurrentY = Y - (intVerSize/2) ' Print text on Report object. Rpt.Print strMessage
End for
End Sub
The coordinates are GPS, the positions are between the upper left corner and lower right corner of the picture (georeferenced).
What I need to do is loop trough each records to get the values for positioning the circles and text on the map. The data come from a query where the catégories of clients is selected.
Thank you in advance
Private Sub Report_Page()
‘Variables and constants for Circle - (Circle Method)
Const conPI = 3.14159265359
Dim sngHCtr As Single, sngVCtr As Single
Dim sngRadius As Single
Dim sngStart As Single, sngEnd As Single
‘Variables for Text over the circles - (Print method)
Dim rpt as ReportDim strMessage As StringDim intHorSize As Integer, intVerSize As Integer
‘Variables for DAO
‘Variables for Loop
Query = “DataXY “
Fields = [Number],[ColorCode],[dX] and [dY]
Label = [Number] ‘Number that Id the circle
ValColor = [ColorCode] ‘ Value of the color of the circle
X = [dX] ‘Coordinate X (position text on map)
Y = [dY] ‘Coordinate Y (position text on map)
For each record in query
Do While not EOF
‘Draw Circle
sngHCtr = X ' Horizontal position.
sngVCtr = Y ' Vertical position.
sngRadius = Me.ScaleHeight / 100 ' Circle radius.
Me.Circle (sngHCtr, sngVCtr), sngRadius ‘Draw Circle
sngStart = -0.00000001 ' Start of pie slice.
sngEnd = -256 * conPI / 129 ' End of pie slice.
Me.FillColor = ValColor ' Color pie slice.
Me.FillStyle = 0 ' Fill pie slice.
Me.ForeColor = ValColor
' Draw pie slice within circle.
Me.Circle (sngHCtr, sngVCtr), sngRadius, , sngStart, sngEnd
‘Draw Text over circle
Set rpt = Me strMessage = Label With rpt 'Set scale to pixels, and set FontName and 'FontSize properties. .ScaleMode = 3 .FontName = "Courier" .FontSize =6 .ForeColor = ValColor .FontBold = 1 End With ' Horizontal width. intHorSize = Rpt.TextWidth(strMessage) ' Vertical height. intVerSize = Rpt.TextHeight(strMessage) ' Calculate location of text to be displayed. Rpt.CurrentX = X - (intHorSize/2) Rpt.CurrentY = Y - (intVerSize/2) ' Print text on Report object. Rpt.Print strMessage
End for
End Sub