如何对齐PRN文件 [英] How to align the prn file

查看:82
本文介绍了如何对齐PRN文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Prn文件打印账单.我给出以下用于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



那样的印刷

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


但我要这样打印

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



怎么做?请帮助我...谢谢.

解决方案

您应该使用padleft和padright来使列的宽度固定.


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

解决方案

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


这篇关于如何对齐PRN文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆