Dim doc As New PrintDoc '定义一个报表
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式
For Each r As Row In Tables("标签打印_table1").GetCheckedRows()
For i As Integer = 1 To r("份")
Dim rt As New prt.RenderTable() '定义一个表格对象
rt.Style.TextAlignHorz = prt.AlignHorzEnum.left '水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt.style.GridLines.bottom = new prt.linedef
rt.style.gridlines.horz = new prt.linedef
rt.style.Padding.Top = 2
rt.Style.Spacing.Right = 18
rt.style.spacing.Top =4
rt.Width = 88 '表格宽度为80mm
rt.cellStyle.Spacing.All = 0.3 '和其他对象之间的间隔为2mm
rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never '避免垂直换页的时候,表格被分割成两部分.
rt.Cols(0).Width = 35
rt.Cells(0,0).SpanCols =2
rt.cells(0,0).text ="Toplon Industrial Co., Ltd"
rt.cells(0,0).Style.Font = New Font("宋体", 14, FontStyle.Bold)
rt.cells(2,0).Text = "DESIGN NO."
rt.cells(2,1).text = r("样品编号")
rt.cells(2,0).Style.Font = New Font("宋体", 10)
rt.cells(2,1).Style.Font = New Font("宋体", 10)
rt.Cells(4,0).Text = "COMPOSITION"
rt.cells(4,1).text = r("成份")
rt.cells(4,0).Style.Font = New Font("宋体", 10)
rt.cells(4,1).Style.Font = New Font("宋体", 10)
rt.Cells(6,0).Text= "WIDTH"
doc.Body.Children.Add(rt)
Dim rbc As New prt.RenderBarCode()
rbc.Height = 5
rbc.style.Padding.Top = 0.5
rbc.BarCodeType = BarCodeEnum.Code39
rbc.BarDirection = BarDirectionEnum.Normal
rbc.Text = r("样品编号")
doc.Body.Children.Add(rbc)
Next
Next
目标功能:实现标签打印,一排两个,每张纸打印12个