Results 1 to 5 of 5

Thread: Printer Alignment

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Location
    South Africa
    Posts
    3

    Printer Alignment

    Ok here goes

    Im currently Writing a POS System in VB6.its actually quite far

    My printing is done on a POS Printer im using the following code that prints the data from a listview and some other controls onto the POS Printer

    Printer alignment is my Problem:
    vb Code:
    1. ssql = "Select posprinter from [Settings] "
    2. Ocom.CommandText = ssql
    3. Set orec = Ocom.Execute
    4.   Dim prnPrinter As Printer
    5.     For Each prnPrinter In Printers
    6.     If prnPrinter.DeviceName = orec!posprinter Then
    7.     Set Printer = prnPrinter
    8.     Exit For
    9.     End If
    10.     Next
    11.  
    12. 'Open Till Draw
    13. Printer.Print "A"
    14.  
    15. Printer.Font.Size = 9.5
    16. Printer.FontName = "Arial"
    17. Printer.Font.Size = 12
    18.  
    19. Printer.Font.Bold = True
    20. Set orec = New Recordset
    21. ssql = "Select * from [Company Info]"
    22. Ocom.CommandText = ssql
    23. Set orec = Ocom.Execute
    24. Printer.Print orec!Coname
    25.  
    26. Printer.Font.Size = 9.5
    27. Printer.FontName = "FontA1x1"
    28. Printer.Print orec!Coline2
    29. Printer.Print orec!coaddress1
    30. Printer.Print orec!coaddress2
    31. Printer.Print orec!coaddress3 + "," + orec!coaddress4
    32. Printer.Print "Tel: " + orec!cophoneno
    33. Printer.Print "Vat Reg: " + orec!coregno
    34.  
    35. Printer.Font.Size = 19
    36. Printer.FontName = "FontA1x2"
    37. Printer.Print " "
    38. A$ = "TAX INVOICE"
    39. Printer.Print A$
    40.  
    41. Printer.Font.Size = 9.5
    42.  
    43. Printer.Font.Size = 9.5
    44. 'Printer.FontName = "FontA1x1"
    45. Printer.FontName = "courier new"
    46. Printer.Font.Bold = True
    47. Printer.Print "Customer      : " & txtCustomerName
    48. Printer.Print "Date          : " & lblDate
    49. Printer.Print "Time          : " & lblTime
    50. Printer.Print "Sales Person  : " & lblUser
    51. Printer.Print "Slip No       : " & InvoiceId
    52. Printer.Print "-----------------------------------------"  'LF
    53.  
    54. For Each Lst In FrmPOS.lstvInvoice.ListItems
    55. Printer.Print Lst.SubItems(1) & " "
    56.  
    57. Printer.Print Format(Lst.SubItems(2), "#####0") & " "
    58.  
    59. Printer.Print Lst.SubItems(4) & " " & Lst.SubItems(10)
    60. Next
    61.  
    62. Printer.Font.Size = 9.5
    63. Printer.FontName = "Courier New"
    64. 'Printer.FontName = "FontA1x1"
    65. Printer.Print "-----------------------------------------"  'LF
    66.  
    67. Printer.Font.Size = 10
    68. Printer.FontName = "Arial"
    69. Printer.Font.Bold = True
    70.  
    71. Printer.Print "Total  :" + FormatNumber(txtTotal, 2)
    72. Printer.Print "Cash   :" + FormatNumber(txtTendered, 2)
    73. Printer.Print "Change :" + FormatNumber(txtChange, 2)
    74.  
    75. Printer.Font.Size = 9.5
    76. 'Printer.FontName = "FontA1x1"
    77. Printer.FontName = "Courier New"
    78. Printer.Font.Bold = True
    79.  
    80. Printer.Print "Thank you for your Support"
    81. Printer.Print "Visit us: www.distinctiv.net"
    82. Printer.Print "Email us: [email][email protected][/email]"
    83. Printer.Print "KEEP THIS TILL SLIP AS PROOF OF PURCHASE"
    84.  
    85. Printer.Print ""
    86. Printer.Print ""
    87. Printer.Print ""
    88. Printer.Print ""
    89. Printer.Print ""
    90.  
    91. Printer.EndDoc
    92.  
    93. MsgBox "Please Remove Change and Close Till Draw"
    I basically want certain things left aligned and some right aligned

    for eg the numeric fields need to be right aligned so that figures line up

    Please Assist

    Mr Rieda Hoosain
    Last edited by Hack; May 11th, 2007 at 06:36 AM. Reason: Edited EMail address and added VB Highlight Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width