Dim 公司代码 As String=e.Form.Controls("txb_前缀文本").value
Dim 编号类型 As String=e.Form.Controls("dpb_编号类型").value
Dim 出厂日期 As Date=e.Form.Controls("dtp_出厂日期").value
Dim doc As New PrintDoc
Dim rs As List(Of Row) = Tables(e.Form.name & "_tab_1").GetCheckedRows
Dim count As Integer = rs.count
doc.PrinterName="ZDesigner GT800 (EPL) -2#"
doc.PageSetting.Height=12
'doc.PageSetting.Width=12*count+(count-1) * 5
doc.PageSetting.Width=40
doc.PageSetting.BottomMargin=0
doc.PageSetting.TopMargin=0
doc.PageSetting.RightMargin=0
doc.PageSetting.LeftMargin=0
doc.PageSetting.Landscape=True
'Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim Bar As New BarCodeBuilder
bar.QuietZoneWidth =2 '0.4
Bar.Symbology = Barpro.Symbology.QRCode
'bar.CodeAlignment = Barpro.Alignment.Belowleft
For i As Integer = 0 To rs.Count - 1
Dim r As Row = rs(i)
Dim rg As New prt.RenderGraphics
bar.code=r("打印列")
MessageBox.show(r("打印列"))
bar.DrawOnCanvas(rg.Graphics,0,0,0.25)
Dim rt As New prt.RenderTable() '定义一个表格对象
rt.Style.GridLines.All = New prt.Linedef(Color.white) '将表格的颜色设为深灰色
rt.Rows.Count = 1 '设置行数
rt.Cols.Count = 2 '设置列数
rt.Width = 40 '设置表格的宽度
rt.Height = 12 '设置表格的高度
'If i > 0 Then
' rt.Style.Spacing.Top = 4
' rt.Height = 16
'End If
rt.Rows(0).Height=12
rt.cols(0).width=15
rt.cells(0,1).Style.Font=New Font("Times New Roman", 7, FontStyle.Bold) '设置字体
rt.cells(0,0).Style.TextAlignHorz=prt.AlignHorzEnum.left
'Dim r As Row=Tables(e.Form.name & "_tab_1").Rows(0)
rt.Cells(0,0).RenderObject = rg '将单元格内容设置为图片对象rm
rt.cells(0,1).text=公司代码 & "-" & 编号类型 & vbcrlf & Format(出厂日期,"yyyyMMdd") & "-" & r("流水号")
doc.Body.Children.Add(rt) '将表格对象加入到报表中
Next
doc.Preview