Dim doc As New PrintDoc
Dim rg As New prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.qrcode '指定打印的条码类型: QRcode 指二维码
Dim tb As New prt.RenderTable() '定义一个表格对象
doc.Body.Children.Add(tb) '将表格对象加入到报表中
Dim i As Integer = 0
For Each r As Row In Tables("sy_tmprint").rows '指定打印的表
bar.Code = r("tmdycode") '指定打印的条码字段
bar.Text = "SN " & bar.code '需要在条码下方显示的打印同容
Bar.TextAlignment = Barpro.Alignment.BelowCenter
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,0.28) '条码比例缩放控制
Dim ra As prt.RenderArea = tb.Cells(i \ 2, i Mod 2).area '指定要打印的列数
ra.children.add(rg)
'doc.PageSetting.Width = 22.6 '纸张宽度为22.6毫米
'doc.PageSetting.Height = 10
'doc.PageSetting.Landscape = False '横向打印
i += 1
Next
Doc.Preview()