1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
''Valeur du tableau
Dim ValPreparateur As String
Dim B, C, D As Integer
Dim dr, dr2 As DataRow
X = 100
Y = 300
Z = 1
C = 0
D = 0
TextSql = "select distinct datepvt from " & Choix & " where datepvt between " & IntDateStart & " and " & IntDateEnd & " group by datepvt order by datepvt asc"
Dim CmdImpression = New OleDbCommand(TextSql, DBAccess)
DRImpressionsDate = CmdImpression.ExecuteReader
TextSql = "select nomuser, datepvt, format(avg(productivite),'##.##') as moyenne from " & Choix & " where datepvt between " & IntDateStart & " and " & IntDateEnd & " group by nomuser, datepvt order by nomuser asc, datepvt asc "
Dim CmdImpression2 = New OleDbCommand(TextSql, DBAccess)
DRImpressionsInfos = CmdImpression2.ExecuteReader
TextSql = "select distinct nomuser from " & Choix & " where datepvt between " & IntDateStart & " and " & IntDateEnd & " group by nomuser order by nomuser asc"
Dim CmdImpression3 = New OleDbCommand(TextSql, DBAccess)
DRImpressionsPreparateur = CmdImpression3.ExecuteReader
If DRImpressionsPreparateur.HasRows = True Then
For Each datarow In DRImpressionsPreparateur
ValPreparateur = DRImpressionsPreparateur.GetString(0).ToString
TextSql = "select nomuser, datepvt, format(avg(productivite),'##.##') as moyenne from " & Choix & " where datepvt between " & IntDateStart & " and " & IntDateEnd & " and nomuser = '" & ValPreparateur & "' group by nomuser, datepvt order by nomuser asc, datepvt asc "
Dim DRImpressionsDate2 As OleDbDataReader
Dim CmdImpressionDate2 = New OleDbCommand(TextSql, DBAccess)
DRImpressionsDate2 = CmdImpressionDate2.ExecuteReader
text = ValPreparateur
e.Graphics.DrawString(text, PrintText, System.Drawing.Brushes.Black, 50, 200)
B = 0
If DRImpressionsDate2.HasRows = True Then
For Each dr2 In DRImpressionsDate2
If DRImpressionsDate2.GetInt32(1).ToString = IntDateStart Then
text = DRImpressionsDate2.GetInt32(2).ToString
e.Graphics.DrawString(text, PrintText, System.Drawing.Brushes.Black, 200, 200 + A)
Else
Dim ValEcart As Integer
ValEcart = DRImpressionsDate2.GetInt32(1).ToString - IntDateStart
text = DRImpressionsDate2.GetInt32(2).ToString
e.Graphics.DrawString(text, PrintText, System.Drawing.Brushes.Black, (ValEcart * 100) + 200, 200 + A)
End If
If Z = 1 Then
If DRImpressionsDate.HasRows = True Then
Dim DataRowDate As DataRow
X = 0
For Each DataRowDate In DRImpressionsDate
text = Mid(DRImpressionsDate.GetInt32(0).ToString, 6, 2) & "/" & Mid(DRImpressionsDate.GetInt32(0).ToString, 4, 2)
e.Graphics.DrawString(text, PrintText, System.Drawing.Brushes.Black, 200 + X, 180)
X += 50
Next
End If
End If
B += 20
Next
End If
Z += 1
Next
End If |
Partager