Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Printing in pre printed stationer - viusal basic

Dear friends,

I developed one project for bill printing ( sales billing) i wish to print using pre printed stationery.

Paper size height 6"inches width 9.1 " inches

I have printing problem printing is not done at correct position. one bill printed 2 bills skipped. Please give me advice

How can i set Printer.PaperSize = ?

My code is here. please give me solution

Dim cy As Long
Dim cx As Long
Dim tmpval As Double


Printer.Height = 8640
Printer.Width = 13104


Printer.Font = "Arial"
Printer.FontBold = True
Printer.CurrentX = 9360
Printer.CurrentY = 2304
Printer.FontSize = 10
Printer.Print datetxt.Text
Printer.Print " Bill Date : " & datetxt.Text

Printer.CurrentX = 9360
Printer.CurrentY = 2736 ' 2300
Printer.Print "Bill No: " & Bnotxt.Text
Printer.CurrentX = 2880 '3160
Printer.CurrentY = 2304
Printer.Print cnametxt.Text
'Printer.Print "Customer Name : " & cnametxt.Text
Printer.CurrentX = 2880
Printer.CurrentY = 2736 ' 2500
Printer.Print cptxt.Text
'Printer.CurrentX = 7200
'Printer.CurrentY = 2304
'Printer.Print "Bill Mode : " & btype
'Printer.CurrentX = 864 '1440
'Printer.CurrentY = 3312
'Printer.Print "Sno Product Name Grams Wastage Price M-Charge S-Charge Amount "
Printer.CurrentX = 864
Printer.CurrentY = 3168 '3312
Printer.Print "S.NO"
Printer.CurrentX = 1584
Printer.CurrentY = 3168 '3312
Printer.Print "PARTICULARS"
Printer.CurrentX = 4064
Printer.CurrentY = 3168 ' 3312
Printer.Print "GRAMS"
Printer.CurrentX = 5216
Printer.CurrentY = 3168
Printer.Print "WASTAGE"
Printer.CurrentX = 6368
Printer.CurrentY = 3168
Printer.Print "RATE"
Printer.CurrentX = 7376
Printer.CurrentY = 3168
Printer.Print "M.C"
Printer.CurrentX = 8400
Printer.CurrentY = 3168
Printer.Print "S.C"
Printer.CurrentX = 9400
Printer.CurrentY = 3168
Printer.Print "AMOUNT"
Printer.FontBold = False
Printer.FontSize = 10

cy = 3600
i = 1
While i <= sno
mg1.Row = i
mg1.Col = 0
Printer.CurrentX = 864 '1440
Printer.CurrentY = cy
Printer.Print mg1.Text

Printer.CurrentX = 1584 '2160
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 2
Printer.Print mg1.Text

cx = 4064 '2900
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 3 '3
tmpval = Format(mg1.Text, "#0.000")
Select Case Len(tmpval)
Case 4
Printer.CurrentX = cx + 400
Case 5
Printer.CurrentX = cx + 300
Case 6
Printer.CurrentX = cx + 200
Case 7
Printer.CurrentX = cx + 100
Case 8
Printer.CurrentX = cx
End Select
Printer.Print mg1.Text

cx = 5216 '3800
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 5 '4
tmpval = Format(mg1.Text, "#0.000")
Select Case Len(tmpval)
Case 4
Printer.CurrentX = cx + 400
Case 5
Printer.CurrentX = cx + 300
Case 6
Printer.CurrentX = cx + 200
Case 7
Printer.CurrentX = cx + 100
Case 8
Printer.CurrentX = cx
End Select
Printer.Print mg1.Text

cx = 6360 '4750 - 6368
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 6 '5
tmpval = Format(mg1.Text, "#0.00")
Select Case Len(tmpval)
Case 4
Printer.CurrentX = cx + 500
Case 5
Printer.CurrentX = cx + 400
Case 6
Printer.CurrentX = cx + 300
Case 7
Printer.CurrentX = cx + 200
Case 8
Printer.CurrentX = cx + 100
Case 9
Printer.CurrentX = cx
End Select
Printer.Print mg1.Text

cx = 7376 '5600
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 7 '6
tmpval = Format(mg1.Text, "#0.00")
Select Case Len(tmpval)
Case 4
Printer.CurrentX = cx + 400
Case 5
Printer.CurrentX = cx + 300
Case 6
Printer.CurrentX = cx + 200
Case 7
Printer.CurrentX = cx + 100
Case 8
Printer.CurrentX = cx
End Select
Printer.Print mg1.Text

cx = 8400 '6500
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 8 '7
tmpval = Format(mg1.Text, "#0.00")
Select Case Len(tmpval)
Case 4
Printer.CurrentX = cx + 400
Case 5
Printer.CurrentX = cx + 300
Case 6
Printer.CurrentX = cx + 200
Case 7
Printer.CurrentX = cx + 100
Case 8
Printer.CurrentX = cx
End Select
Printer.Print mg1.Text
'-- SEN DO
cx = 9300 ' 7300 -9400
Printer.CurrentY = cy
mg1.Row = i
mg1.Col = 9
tmpval = Format(mg1.Text, "#0.00")
Select Case Len(tmpval)
Case 4
Printer.CurrentX = cx + 600 ' 600
Case 5
Printer.CurrentX = cx + 500 ' 500
Case 6
Printer.CurrentX = cx + 400 ' 400
Case 7
Printer.CurrentX = cx + 300 ' 300
Case 8
Printer.CurrentX = cx + 200 '200
Case 9
Printer.CurrentX = cx + 100 ' 100
Case 10
Printer.CurrentX = cx
End Select
mg1.CellAlignment = 3
Printer.Print mg1.Text
i = i + 1
cy = cy + 300
Wend

Printer.FontBold = True
Printer.FontSize = 9
Printer.CurrentX = 720 ' 6000
Printer.CurrentY = cy + 300
'Printer.Print "Total Amount :" & tottxt.Text
Printer.CurrentX = 2880 '6000
Printer.CurrentY = 7200 'cy + 600
Printer.Print "Discount : " & disctxt.Text
Printer.CurrentX = 6000
Printer.CurrentY = 7200 ' cy + 900
Printer.Print vattxt.Text
Printer.CurrentX = 9216 '6000
Printer.CurrentY = 7290 'cy + 1200
Printer.Print Netamttxt.Text
'Printer.Print "Net Amount : " & Netamttxt.Text
Printer.EndDoc
Sign In or Register to comment.