调用模板打印vb.net 打印的模板
vb.net 传参调用BarTender模板实现动态打印
你用的版本太高了吧。 我用的7.75 你参考一下 先要打开bartend.exe Shell ("D:\Program Files\Seagull\BarTender\7.75\bartend.exe /af=E:\abc\abc.btw /p /x /?qdh=""" randqdh """") dll应该是不用调用的,调用dll需要用正版
创新互联是一家成都网站建设、网站设计,提供网页设计,网站设计,网站制作,建网站,定制网站设计,网站开发公司,于2013年创立是互联行业建设者,服务者。以提升客户品牌价值为核心业务,全程参与项目的网站策划设计制作,前端开发,后台程序制作以及后期项目运营并提出专业建议和思路。
VB.NET程序如何实现表格填写和打印
一般情况下先用EXCEL做好一个样表文件,设定好打印区域和样式,需要填内容的时候,先程序复制一个样表文件,然后调用API打开表格填写内容并打印,如果想用API来实现调整模板和打印预览,可能比较困难,而且很抽象,个人觉得费时费力效果还不一定理想
VB.NET 打印问题。
先拖过来控件PrintDocument1,然后双击PrintDocument1,在它的PrintPage事件中加入代码如下:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
dim a as String
a="abcd"
Dim mypen As Pen = New Pen(Color.Blue, 2)
e.Graphics.DrawString(a, New Font("宋体", 20), New Pen(Color.Black, 1).Brush, 30, 30)
End Sub
调用下面语句可直接用默认打印机打印出来:
PrintDocument1.Print()
VB.net 我买了一个超市用的热敏打印机,现在想打印一些小票。我想知道如何把textbox的内容打印出来。
1、热敏打印机(超市打印小票的那种)其实和办公用的打印机没有根本区别,只是用途不同罢了。
2、热敏打印机与计算机连接的接口基本上有3种(并口、串口和USB口),不管哪种,都要把那个连接线与计算机背后的插槽连好(接口是对应好了的,搞错了是接不上的),然后安装正确打印机驱动程序。
3、在大家熟悉使用的WORD文字编辑程序程序中,讲页面宽度自定义调整为热敏纸的规格,页面长度一般210毫米就够用了。记得要把这个保存为模板,方便以后调用此格式。
4、好了,就用上面的那个模板随便编辑内容,发送打印任务到热敏机就行啦。试试吧,字符再长在WORD里都会自动换行滴。
vb调用excel模板进行打印
Sub outputExcel()
On Error GoTo merr
Dim a As Object
Set a = CreateObject("Excel.Application")
a.visible = True
Dim w As Object
Set w = a.Worksheets("sheet1")
Dim s() As String
Dim ns As Integer
ns = 10
ReDim s(ns - 1)
Dim col As Integer
Dim f As Field, title As String
Dim tmp1 As Variant, tmp2 As Variant
Dim fieldName As String
With de1.rsselTmpReport
If .RecordCount 0 Then
col = 0
de1.rsexcel.MoveFirst
Do While Not de1.rsexcel.EOF
If de1.rsexcel.Fields("isprint").Value Then
If LANG = 0 Then
title = de1.rsexcel.Fields("title").Value
Else
title = de1.rsexcel.Fields("title_en").Value
End If
col = col + 1
w.Cells(Count + 3, col).Value = title
w.Cells(Count + 3, col).HorizontalAlignment = -4108
w.Cells(Count + 3, col).VerticalAlignment = -4108
End If
de1.rsexcel.MoveNext
Loop
w.range("A1:" + IntToLetter(col - 1) + "1").Select
a.Selection.Merge
.MoveFirst
While Not .EOF
col = 0
de1.rsexcel.MoveFirst
Do While Not de1.rsexcel.EOF
If de1.rsexcel.Fields("isprint").Value Then
title = de1.rsexcel.Fields("title").Value
col = col + 1
If de1.rsexcel.Fields("fieldname").Value = "crsd" Then
'maybe str , val()
If Not IsNull(.Fields("cstd")) Then
tmp1 = myFieldValue(.Fields("cstd"))
tmp1 = Val(tmp1)
tmp2 = myFieldValue(.Fields("c"))
tmp2 = Val(tmp2)
w.Cells(Count + 4, col).Value = myDiv(tmp1, tmp2)
End If
ElseIf de1.rsexcel.Fields("fieldname").Value = "srsd" Then
If Not IsNull(.Fields("sstd")) Then
tmp1 = myFieldValue(.Fields("sstd"))
tmp1 = Val(tmp1)
tmp2 = myFieldValue(.Fields("s"))
tmp2 = Val(tmp2)
w.Cells(Count + 4, col).Value = myDiv(tmp1, tmp2)
End If
Else
fieldName = de1.rsexcel.Fields("fieldname").Value
tmp1 = myFieldValue(.Fields(fieldName))
w.Cells(Count + 4, col).Value = tmp1
End If
w.Cells(Count + 4, col).HorizontalAlignment = -4108
w.Cells(Count + 4, col).VerticalAlignment = -4108
Select Case de1.rsexcel.Fields("fieldname").Value
Case "c", "s", "cstd", "sstd", "weight":
w.Cells(Count + 4, col).NumberFormat = "0.0000"
Case "crsd", "srsd"
w.Cells(Count + 4, col).NumberFormat = "0.0%"
End Select
End If
de1.rsexcel.MoveNext
Loop
Count = Count + 1
.MoveNext
Wend
End If
End With
w.range("A3:" + IntToLetter(col - 1) + CStr(Count + 4 - 1)).Select
a.Selection.Borders(7).LineStyle = 1
a.Selection.Borders(7).weight = 2
a.Selection.Borders(7).ColorIndex = -4105
a.Selection.Borders(8).LineStyle = 1
a.Selection.Borders(8).weight = 2
a.Selection.Borders(8).ColorIndex = -4105
a.Selection.Borders(9).LineStyle = 1
a.Selection.Borders(9).weight = 2
a.Selection.Borders(9).ColorIndex = -4105
a.Selection.Borders(10).LineStyle = 1
a.Selection.Borders(10).weight = 2
a.Selection.Borders(10).ColorIndex = -4105
a.Selection.Borders(11).LineStyle = 1
a.Selection.Borders(11).weight = 2
a.Selection.Borders(11).ColorIndex = -4105
a.Selection.Borders(12).LineStyle = 1
a.Selection.Borders(12).weight = 2
a.Selection.Borders(12).ColorIndex = -4105
w.Cells.Select
a.Selection.Columns.AutoFit
Exit Sub
merr:
saveerrmsg
End Sub
从我的程序中截取的部分代码供你参考。
vb调用excel模板打印,一张打印不完,第二页第三页等还继续调用该模板.
看一下每页不同内容一共是多少行多少列,比如,你这个是15列,假设每页打印25个人的工资,那么定义一个数组 dim lsA(1 to 25,1 to 15) as string,每打一页,先读取25个人的信息到这个数组lsA,再给电子表格区域"A4:O28"赋值,再打印就可以了。以下代码是一个给表格赋值的例子。
Dim yEx As Excel.Application
Dim dA(1 To 3, 1 To 3) As String
dA(1, 1) = "a11"
dA(1, 2) = "a12"
dA(1, 3) = "a13"
dA(2, 1) = "a21"
dA(3, 3) = "a33"
Set yEx = New Excel.Application
yEx.Workbooks.Add
MsgBox yEx.Sheets(1).Name
yEx.Sheets("Sheet1").Range("A4:C6") = dA
yEx.Visib
Set yEx = Nothingle = True
yEx.Workbooks.Close
当前标题:调用模板打印vb.net 打印的模板
本文来源:http://azwzsj.com/article/hpeejc.html