Cambiar tamaño de reporte impreso
Publicado por HUMBERTO (1 intervención) el 13/08/2016 16:33:04
Tengo éste código de un sistema de inventarios pero necesito cambiar el tamaño de la impresión a media carta.
¿Qué tengo que hacer?
¿Qué tengo que hacer?
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
Sub Main()
ImprimeRemision
End Sub
Public Sub ImprimeRemision()
' Creamos el recordSet del encabezado de la venta
Set rstEncabezado = rst("SELECT * FROM ventas WHERE venta = " & prn.Documento, Ambiente.Connection)
' Creamos el recordSet de las partidas que componen la venta
Set rstPartidas = rst("SELECT * FROM partvta WHERE venta = " & rstEncabezado("Venta"), Ambiente.Connection)
' Traemos todos los datos del cliente
Set rstCliente = rst("SELECT * FROM clients WHERE cliente = '" & rstEncabezado("Cliente") & "'", Ambiente.Connection)
' Los datos de la moneda
Set rstMoneda = rst("SELECT * FROM monedas WHERE moneda = '" & rstEncabezado.Fields("Moneda") & "'", Ambiente.Connection)
' Los datos del vendedor
Set rstVendedor = rst("SELECT * FROM vends WHERE vend = '" & rstEncabezado.Fields("vend") & "'", Ambiente.Connection)
'Indicamos cual es la impresora que deseamos utilizar
EstableceImpresora Ambiente.rstEstacion("ImpRem")
PaperSize 256,8.5,11,"REMISIONES"
' Iniciamos la Impresión del encabezado de la forma
IniciaDocumento
' Colocamos en una variable si el movimiento esta vivo o cancelado
If rstEncabezado("Estado") = "CA" Then
Estado = "CANCELADO"
End If
If rstEncabezado("Estado") = "CO" Then
Estado = "FACTURADO"
End If
EstableceFuente "Times New Roman",21.75
FontBold Verdadero
FontItalic Falso
ColorDeFuente 0
Say 1.78125,3.5, rstCliente("Nombre")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente -2147483630
Say 0.4895833,0.1770833, rstCliente("Calle")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente -2147483630
Say 0.7604167,0.1770833, rstCliente("Colonia")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente -2147483630
Say 0.7708333,1.895833, rstCliente("pobla")
EstableceFuente "Arial",9.75
FontBold Verdadero
FontItalic Falso
ColorDeFuente 16711680
Say 1.010417,0.1770833, rstCliente("RFC")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 0.8020833,2.822917, rstCliente("Estado")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 1.020833,5.052083, rstCliente("cp")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 1.020833,3.875, "Código postal"
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 1.239583,0.1875, Formato( rstEncabezado("f_emision"), "dd-MMMM-yyyy" )
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 1.25,2.166667, "Vencimiento: "
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 1.25,3.28125, rstEncabezado("F_venc")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 8.166667,0.3333333, Letra( Round( rstEncabezado("Importe") + rstEncabezado("Impuesto"), 2 ), Trim(rstMoneda("Descrip")), True,rstMoneda.fields("Nombre") )
EstableceFuente "Courier New",12.75
FontBold Verdadero
FontItalic Falso
ColorDeFuente 0
Say 9.104167,6.5, PadL(Formato(rstEncabezado("Importe"), Ambiente.FDinero), 10)
EstableceFuente "Courier New",12.75
FontBold Verdadero
FontItalic Falso
ColorDeFuente 0
Say 9.364583,6.5, PadL( Formato(rstEncabezado("Impuesto"), Ambiente.FDinero), 10 )
EstableceFuente "Courier New",14.25
FontBold Verdadero
FontItalic Falso
ColorDeFuente 0
Say 9.729167,6.239583, PadL( Formato(rstEncabezado("Importe") + rstEncabezado("Impuesto"), Ambiente.FDinero),10 )
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
ImprimeTexto 7.375,0.3125, rstEncabezado("Observ")
EstableceFuente "Times New Roman",9
FontBold Verdadero
FontItalic Falso
ColorDeFuente 65280
Say 1.645833,0.3958333, " Hola "
Incremento = 0
If Val2( rstEncabezado("nodesglosedetalle") ) = 0 Then
While Not rstPartidas.EOF
Set rstArticulo = CreaRecordSet( "SELECT * FROM prods WHERE articulo = '" & rstPartidas("articulo") & "'", Ambiente.Connection )
Set rstSeries = CreaRecordSet("SELECT * FROM series WHERE documento = 'REMISION' AND numeroDocumento = " & rstEncabezado("no_referen")& " AND articulo = '" & rstPartidas("articulo") & "'" , Ambiente.Connection)
If rstArticulo("serie") <> 0 Then
EstableceFuente "Arial",9.75
FontBold Verdadero
FontItalic Falso
ColorDeFuente 0
Say 4.479167 + Row (incremento), 4.052083, Trim( rstSeries("serie"))
End If
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 0.21875,rstPartidas("Articulo")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 1.041667,rstArticulo("Descrip")
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 4.552083,PadL(Formato( rstPartidas("Precio"), Ambiente.FDinero ),10)
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 5.260417,PadL(Formato( rstPartidas("Cantidad"), Ambiente.Formato ),10)
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 5.9375,Formato( rstPartidas("Descuento"), "% ##.00" )
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 6.489583,PadL( Formato( rstPartidas("Precio") * (1 - ( rstPartidas("Descuento") / 100 ) ), Ambiente.FDinero ),10)
EstableceFuente "Verdana",9.75
FontBold Falso
FontItalic Falso
ColorDeFuente 0
Say 2.78125 + Row( Incremento ), 7.166667,PadL( Formato( rstPartidas("Precio") * (1 - ( rstPartidas("Descuento") / 100 ) ) * rstPartidas("cantidad"), Ambiente.FDinero ),10)
Incremento = Incremento + 1
rstPartidas.MoveNext
Wend
End If
FinDocumento
End Sub
Public Sub ImprimeTexto( nComenzar, nColumna, cTexto )
Dim nRenglon
nLineas = CuantasLineas((cTexto))
nRenglon = 0
For n = 1 To nLineas
Say nComenzar + Row(nRenglon), nColumna, strLinea(cTexto, n)
nRenglon = nRenglon + 1
Next
End Sub
Public Function Si( bolCond, uDato1, uDato2 )
Dim nRenglon
If bolCond = True Then
Si = uDato1
Else
Si = uDato2
End If
End Function
Valora esta pregunta


0