Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Prn file for printing bill. I give the following coding for print

   For kk = 0 To dtt.Rows.Count - 1
       Print(FN, TAB(0), s, TAB(6), dtt.Rows(kk).Item(1).ToString, TAB(22),        dtt.Rows(kk).Item(2), TAB(26), Format(dtt.Rows(kk).Item(3), "########00.00"), TAB(34), Format(dtt.Rows(kk).Item(4), "########00.00"))
       PrintLine(FN)
       s = s + 1
       tot = tot + dtt.Rows(kk).Item(4)
Next

It is print like
1   POORI            12 115.00   180.00
2   IDLY             34 23.00   782.00
3   BONDA            34 33.00   1122.00
4   MEALS            34 40.00   1360.00

but i want print like this
1   POORI            12 115.00    180.00
2   IDLY             34  23.00    782.00
3   BONDA            34  33.00   1122.00
4   MEALS            34  40.00   1360.00


How to do it? Please help me...Thanks in advance
Posted
Updated 10-Aug-12 20:11pm
v2
Comments
Kenneth Haugland 11-Aug-12 2:14am    
You need to partition the printing area into cells, and align the text to the right... I dont know how to do it with the code you are using so....
Maciej Los 14-Aug-12 9:25am    
You use a Print command to "push" data in to text file. To save data in a text file, see here: http://msdn.microsoft.com/en-us/library/6ka1wd3w%28v=vs.80%29.aspx and/or http://msdn.microsoft.com/en-us/library/b9skfh7s%28v=vs.80%29.aspx.
Is it VB.NET or VB?

1 solution

You should use padleft and padright to make your columns of fixed width.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900