Alinear datos al imprimir (entra solo si eres freg
Publicado por Mauricio Pachecon (3 intervenciones) el 12/05/2002 04:53:19
Hola, hize un programa en Vb6 y cuando lo corro tengo un problema de alineacion con la impresion osea
me sale asi:
cantidad precio unitario total
producto1 1 15 15
producto2 1 26 26
producto3 2 14 28
producto4 1 8 8
y necesito alinear los datos ¿como le hago?
mi codigo fuente es:
Private Sub Imp_Click()
Printer.Font.Size = 9
Printer.FontName = "times new Roman"
For C = 0 To 4
Printer.Print " "
Next
Printer.Print "Producto " & "Cantidad " & " Precio " & " Tot. Parcial"
For C = 0 To Form2.List1.ListCount
espacios1 = Len(List1.List(C))
restantes1 = (46 - espacios1)
MsgBox Len(List1.List(C)) & " " & " " & restantes1
Printer.Print List1.List(C); Spc(restantes1); List2.List(C) & " "; List3.List(C) & " "; List4.List(C) & " "; Chr(10)
Next
Printer.Print " "
Printer.Print " "
Printer.FontSize = 13
Printer.FontName = "SYSTEM"
printer.Print "El total a pagar es de " & Label5.Caption & " pesos"
Printer.Print " "
Printer.Print " "
Printer.FontSize = 16
Printer.FontName = "Bart"
Printer.Print "GRACIAS POR SU COMPRA"
Printer.EndDoc
End Sub
me sale asi:
cantidad precio unitario total
producto1 1 15 15
producto2 1 26 26
producto3 2 14 28
producto4 1 8 8
y necesito alinear los datos ¿como le hago?
mi codigo fuente es:
Private Sub Imp_Click()
Printer.Font.Size = 9
Printer.FontName = "times new Roman"
For C = 0 To 4
Printer.Print " "
Next
Printer.Print "Producto " & "Cantidad " & " Precio " & " Tot. Parcial"
For C = 0 To Form2.List1.ListCount
espacios1 = Len(List1.List(C))
restantes1 = (46 - espacios1)
MsgBox Len(List1.List(C)) & " " & " " & restantes1
Printer.Print List1.List(C); Spc(restantes1); List2.List(C) & " "; List3.List(C) & " "; List4.List(C) & " "; Chr(10)
Next
Printer.Print " "
Printer.Print " "
Printer.FontSize = 13
Printer.FontName = "SYSTEM"
printer.Print "El total a pagar es de " & Label5.Caption & " pesos"
Printer.Print " "
Printer.Print " "
Printer.FontSize = 16
Printer.FontName = "Bart"
Printer.Print "GRACIAS POR SU COMPRA"
Printer.EndDoc
End Sub
Valora esta pregunta
0