Impresion punto de venta
Publicado por Federico (2 intervenciones) el 29/08/2016 22:57:00
Hola a todos. estoy con un problema de impresion y quisiera saber si pueden brindarme ayuda.
Trato de imprimir en una mini impresora bematech mp-4200 th
el problema es que imprime en la parte inferior y en la parte superior me deja en blanco. Quisiera que imprima en la parte superior y que corte la hoja y finalice la impresion. Dejo el codigo.
MUCHAS GRACIAS DE ANTE MANO
Trato de imprimir en una mini impresora bematech mp-4200 th
el problema es que imprime en la parte inferior y en la parte superior me deja en blanco. Quisiera que imprima en la parte superior y que corte la hoja y finalice la impresion. Dejo el codigo.
MUCHAS GRACIAS DE ANTE MANO
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Private Sub print_PrintPage(ByVal sender As Object, _
ByVal e As PrintPageEventArgs)
' Este evento se producirá cada vez que se imprima una nueva página
Dim xPos As Single = e.MarginBounds.Top
Dim xxPos As Single = e.MarginBounds.Top
Dim aaPos As Single = e.MarginBounds.Top
Dim bbPos As Single = e.MarginBounds.Top
' La fuente a usar
Dim prFont As New Font("Arial", 25, FontStyle.Bold)
Dim tit As New Font("Arial", 32, FontStyle.Bold)
Dim subtit As New Font("Arial", 27, FontStyle.Bold)
Dim prFontt As New Font("Arial", 24, FontStyle.Bold)
Dim total As New Font("Arial", 30, FontStyle.Bold)
' la posición superior
Dim yPos As Single = prFont.GetHeight(e.Graphics)
Dim yyPos As Single = prFont.GetHeight(e.Graphics)
Dim salto_pag As Boolean = False
' 130 es el tope de registros registros a imprimir
' imprimimos la cadena
' 70 es el tope de registros de una hoja con este font
Dim sql As New MySql
'CONOCER EL NUMERO DE COMPROBANTE PARA GRABAR
dt = sql.LEER("Select id_ventas from ventas")
Text_numventa.Text = dt.Rows.Count + 1
For i As Integer = 1 To 1
yPos = 17
xPos = 35
e.Graphics.DrawString("FACTURA CONSUMIDOR FINAL", tit, Brushes.Black, xPos, yPos)
yPos = 130
xPos = 25
e.Graphics.DrawString("LA PASION", subtit, Brushes.Black, xPos, yPos)
yPos = 220
xPos = 25
e.Graphics.DrawString("RUTA 11 KM 256", subtit, Brushes.Black, xPos, yPos)
yPos = 130
xPos = 395
e.Graphics.DrawString("San Justo - Santa Fe", subtit, Brushes.Black, xPos, yPos)
yPos = 175
xPos = 395
e.Graphics.DrawString("Cajero:" & "" & ausuario, subtit, Brushes.Black, xPos, yPos)
yPos = 220
xPos = 395
e.Graphics.DrawString("Fecha:" & "" & Date.Now.ToShortDateString, subtit, Brushes.Black, xPos, yPos)
yyPos = 350
xxPos = 30
aaPos = 790
bbPos = 20
For Each contador1 As DataGridViewRow In Me.DataGridView_Ventas.Rows
codinterno = contador1.Cells(0).Value
descripcion = contador1.Cells(1).Value
cantidad = contador1.Cells(5).Value
'cantidad = contador1.Cells(5).Value
'peso = contador1.Cells(6).Value
precio_lista = contador1.Cells(9).Value
importe = contador1.Cells(10).Value
total2 = CDbl(total2) + CDbl(importe)
yPos = 316
xPos = 0
'----------------------------------------------
yPos = 310
xPos = 20
'xxPos = xxPos + 40
e.Graphics.DrawString("Cant." & "", prFontt, Brushes.Black, xPos, yPos)
e.Graphics.DrawString("" & "" & cantidad, prFontt, Brushes.Black, xxPos, yyPos)
yPos = 310
xPos = 150
xxPos = xxPos + 130
e.Graphics.DrawString("Descripción" & "", prFontt, Brushes.Black, xPos, yPos)
e.Graphics.DrawString("" & "" & descripcion, prFontt, Brushes.Black, xxPos, yyPos)
yPos = 310
xPos = 450
xxPos = xxPos + 300
e.Graphics.DrawString("P. Unitario" & "", prFontt, Brushes.Black, xPos, yPos)
e.Graphics.DrawString("" & "" & precio_lista, prFontt, Brushes.Black, xxPos, yyPos)
yPos = 310
xPos = 650
xxPos = xxPos + 250
e.Graphics.DrawString("Importe" & "", prFontt, Brushes.Black, xPos, yPos)
e.Graphics.DrawString("" & "" & importe, prFontt, Brushes.Black, xxPos, yyPos)
yyPos = yyPos + 30
xxPos = 30
Next contador1
yPos = yyPos + 40
xPos = 470
yyPos = yPos + 4
xxPos = 610
e.Graphics.DrawString("Total:" & "", total, Brushes.Black, xPos, yPos)
e.Graphics.DrawString("" & "" & Text_total.Text, tit, Brushes.Black, xxPos, yyPos)
Next
End Sub
Valora esta pregunta
0