使用vb.net&打印文本文件热敏打印机(不在dos命令中) [英] printing a text file using vb.net & thermal printer (not in dos command)

查看:66
本文介绍了使用vb.net&打印文本文件热敏打印机(不在dos命令中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要像这样打印报告


i need to print report like this


Report(Heading Center)

company name

customer name:XXXX_____________________Bill No.:XXX

_______________________________________Date____:15/5/12
------------------------------------------------------
description___________________qty_____rate______Amount
------------------------------------------------------
cap____________________________10_____150_______1500
watch___________________________2____1299_______2598
pin___________________________100_______1________100
paper___________________________1_______1__________1
----------------------------------------------------






(______________________________)*它是指字母之间的空白*





但我在称职上遇到麻烦

从数据库中,我读取了也以noptepad文件编写的值,但其格式不正确.
所以给我代码来打印txt文件

我得到类似
的结果

公司名称

客户名称:XXXX帐单编号:XXX

日期:15/5/12
-------------------------------------------------- ----
说明数量比率数量
-------------------------------------------------- ----
上限10150 1500
手表2 1299 2598
针100 1 100
纸1 1 1
-------------------------------------------------- -


请帮帮我,我需要获得输出的称呼


感谢






(______________________________)*It Refers the empty space between the letters*





but me getting trouble in allignment

from the database i read the vales that also written in noptepad file but its not in correct arranged format.
so give me the code to print the txt file

me getting result like


company name

customer name:XXXX Bill No.:XXX

Date :15/5/12
------------------------------------------------------
description qty rate Amount
------------------------------------------------------
cap 10 150 1500
watch 2 1299 2598
pin 100 1 100
paper 1 1 1
----------------------------------------------------


Please Help Me i need to get the output is alligned


thanks

推荐答案

.WriteLine(ComStr1.PadRight(15, ""c) & _
  Space(2) & _
 ControlChars.Tab & ComStr2.PadLeft(3," "c) & _
 Space(4) & _
 ControlChars.Tab & ComStr3.ToString.PadLeft(4," "c) & _
 Space(3) & _
 ControlChars.Tab & ComStr11.ToString.PadLeft(5, " "c))




//Comstr1=Description
//ComStr2=Qty
//Comstr3=Rate
//Comstr11=Amount


这篇关于使用vb.net&打印文本文件热敏打印机(不在dos命令中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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