HI,
See the problem is whenever the product desc/Qty/Rate length is increase/decrease the tab position of printing string position is changing,
but it should not happent.see the out put and required output. i ask u people to alter on my code which
should print required output(mention bellow ) correct alienment. i am just using debug.print instead of printer.print later i will replace.
when u execute the code u can realize alienment problem but here output/Required output seems to be same.This editer doesn’t support my
space diferrence.
Private Sub cmd_print_Click()
Dim no As Long
Dim products As String
Dim qty As Integer
Dim rate As Double
Dim rd As Long
products = “a”
rate = 100
no = 1
qty = 1
Debug.Print Tab(3); “No”; Tab(10); “Products”; Tab(35); “Qty”; Tab
(34); “Rate”
Debug.Print “”;
While no <= 12
Debug.Print Tab(3); no; Tab(11); products; Tab(40); qty; Tab(45); FormatNumber(rate, 2, vbTrue, vbTrue,
vbTrue)
products = products + "a"no = no + 1
qty = qty + 5
rate = rate * qty
Wend
End Sub
Output :
No Products Qty Rate
1 a 1 100.00
2 aa 6 600.00
3 aaa 11 6,600.00
4 aaaa 16 105,600.00
5 aaaaa 21 2,217,600.00
6 aaaaaa 26 57,657,600.00
7 aaaaaaa 31 1,787,385,600.00
8 aaaaaaaa 36 64,345,881,600.00
9 aaaaaaaaa 41 2,638,181,145,600.00
10 aaaaaaaaaa 46 121,356,332,697,600.00
11 aaaaaaaaaaa 51 6,189,172,967,577,600.00
12 aaaaaaaaaaaa 56 346,593,686,184,346,000.00
Required Output
No Products Qty Rate
1 a 1 100.00
2 aa 6 600.00
3 aaa 11 2,600.00
4 aaaa 16 205,600.00
5 aaaaa 11 2,217,600.00
6 aaaaaa 26 57,657,600.00
7 aaaaaaa 41 2,638,181,145,600.00
8 aaaaaaaa 46 21,356,332,697,600.00
9 aaaaaaaaa 51 6,189,172,967,577,600.00
10 aaaaaaaaaa 46 121,356,332,697,600.00
11 aaaaaaaaaaa 51 6,189,172,967,577,600.00
12 aaaaaaaaaaaa 46 346,593,686,184,346,000.00
note
Don't consider the values which is printering,pro