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 68 69 70 71 72 73 74 75
| Select Case NumPage
Case 1
While Obj_Reader.Read() And compteur <= 40
Dim ens As String = Obj_Reader.Item("LE_ID").ToString
If (ens <> "") Then
compteur = compteur + 1
If Obj_Reader.GetValue(5).ToString() = "Débit" Then
ev.Graphics.DrawString(Obj_Reader.GetValue(0).ToString(), f, Brushes.Black, xpos + 6, ypos + pos_y)
ev.Graphics.DrawString(FormatDateTime(Obj_Reader.GetValue(1).ToString(), DateFormat.ShortDate), f, Brushes.Black, xpos + 100, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(2).ToString(), f, Brushes.Black, xpos + 194, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(3).ToString(), f, Brushes.Black, xpos + 300, ypos + pos_y)
ev.Graphics.DrawString(toMoney(Obj_Reader.GetValue(4).ToString()), f, Brushes.Black, xpos + 578, ypos + pos_y)
ElseIf Obj_Reader.GetValue(5).ToString() = "Crédit" Then
ev.Graphics.DrawString(Obj_Reader.GetValue(0).ToString(), f, Brushes.Black, xpos + 6, ypos + pos_y)
ev.Graphics.DrawString(FormatDateTime(Obj_Reader.GetValue(1).ToString(), DateFormat.ShortDate), f, Brushes.Black, xpos + 100, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(2).ToString(), f, Brushes.Black, xpos + 194, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(3).ToString(), f, Brushes.Black, xpos + 300, ypos + pos_y)
ev.Graphics.DrawString(toMoney(Obj_Reader.GetValue(4).ToString()), f, Brushes.Black, xpos + 672, ypos + pos_y)
End If
pos_y = pos_y + 20
End If
End While
ev.HasMorePages = True
NumPage += 1
Obj_Reader.Close()
Case 2
While Obj_Reader.Read()
Dim ens As String = Obj_Reader.Item("LE_ID").ToString
If (ens <> "") Then
compteur = compteur + 1
If (compteur > 40) Then
If Obj_Reader.GetValue(5).ToString() = "Débit" Then
ev.Graphics.DrawString(Obj_Reader.GetValue(0).ToString(), f, Brushes.Black, xpos + 6, ypos + pos_y)
ev.Graphics.DrawString(FormatDateTime(Obj_Reader.GetValue(1).ToString(), DateFormat.ShortDate), f, Brushes.Black, xpos + 100, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(2).ToString(), f, Brushes.Black, xpos + 194, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(3).ToString(), f, Brushes.Black, xpos + 300, ypos + pos_y)
ev.Graphics.DrawString(toMoney(Obj_Reader.GetValue(4).ToString()), f, Brushes.Black, xpos + 578, ypos + pos_y)
ElseIf Obj_Reader.GetValue(5).ToString() = "Crédit" Then
ev.Graphics.DrawString(Obj_Reader.GetValue(0).ToString(), f, Brushes.Black, xpos + 6, ypos + pos_y)
ev.Graphics.DrawString(FormatDateTime(Obj_Reader.GetValue(1).ToString(), DateFormat.ShortDate), f, Brushes.Black, xpos + 100, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(2).ToString(), f, Brushes.Black, xpos + 194, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(3).ToString(), f, Brushes.Black, xpos + 300, ypos + pos_y)
ev.Graphics.DrawString(toMoney(Obj_Reader.GetValue(4).ToString()), f, Brushes.Black, xpos + 672, ypos + pos_y)
End If
pos_y = pos_y + 20
End If
End If
End While
ev.HasMorePages = False
NumPage = 1
End Select
Else 'si nombre de ligne < 41
While Obj_Reader.Read()
Dim ens As String = Obj_Reader.Item("LE_ID").ToString
If (ens <> "") Then
If Obj_Reader.GetValue(5).ToString() = "Débit" Then
ev.Graphics.DrawString(Obj_Reader.GetValue(0).ToString(), f, Brushes.Black, xpos + 6, ypos + pos_y)
ev.Graphics.DrawString(FormatDateTime(Obj_Reader.GetValue(1).ToString(), DateFormat.ShortDate), f, Brushes.Black, xpos + 100, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(2).ToString(), f, Brushes.Black, xpos + 194, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(3).ToString(), f, Brushes.Black, xpos + 300, ypos + pos_y)
ev.Graphics.DrawString(toMoney(Obj_Reader.GetValue(4).ToString()), f, Brushes.Black, xpos + 578, ypos + pos_y)
ElseIf Obj_Reader.GetValue(5).ToString() = "Crédit" Then
ev.Graphics.DrawString(Obj_Reader.GetValue(0).ToString(), f, Brushes.Black, xpos + 6, ypos + pos_y)
ev.Graphics.DrawString(FormatDateTime(Obj_Reader.GetValue(1).ToString(), DateFormat.ShortDate), f, Brushes.Black, xpos + 100, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(2).ToString(), f, Brushes.Black, xpos + 194, ypos + pos_y)
ev.Graphics.DrawString(Obj_Reader.GetValue(3).ToString(), f, Brushes.Black, xpos + 300, ypos + pos_y)
ev.Graphics.DrawString(toMoney(Obj_Reader.GetValue(4).ToString()), f, Brushes.Black, xpos + 672, ypos + pos_y)
End If
pos_y = pos_y + 20
End If
End While
End If
Obj_Reader.Close()
End Sub |
Partager