28
« en: Septiembre 29, 2015, 05:52:40 pm »
Haa pero estas programando en Vb.net, el ejemplo que te pase es para el Visual basic 6 no especificaste en que estabas programando.
Pero es casi lo mismo solo que cambia el Print, yo lo hice asi, no tengo ahora instalado el .NET pero aca te dejo mi codigo que use en unos de mis programas.
Sub ImprimirTicket()
Dim xNom, xCan, xSub As String
FileOpen(1, "C:\Factura.txt", OpenMode.Output)
PrintLine(1, "========================================")
PrintLine(1, TAB((40 - Len("COMPROBANTE DE VENTAS")) \ 2), "COMPROBANTE DE VENTAS")
PrintLine(1, "========================================")
PrintLine(1)
PrintLine(1, "----------------------------------------")
PrintLine(1, TAB(0), "CANT", TAB(6), "P R O D U C T O", TAB(34), "SUBTOT")
PrintLine(1, "----------------------------------------")
For I = 0 To Form1.LVentas.Items.Count - 1
xNom = Form1.LVentas.Items(I).Text
xCan = Form1.LVentas.Items(I).SubItems(2).Text
xSub = Form1.LVentas.Items(I).SubItems(3).Text
PrintLine(1, TAB(0), xCan, TAB(6), xNom, TAB(34), xSub)
Next I
PrintLine(1, "----------------------------------------")
PrintLine(1, " TOTAL :", txtTotal.Text)
FileClose(1)
End Sub