其实自己遍历,不知道多方便,你打开CaseStudy目录下的文件: Excel报表.Table
然后在命令窗口执行下面的代码:
Dim doc As New PrintDoc
Dim Bar As New BarCodeBuilder
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Bar.Symbology = Barpro.Symbology.QRCode
For Each r As Row In Tables("员工").Rows
Dim rt As New prt.RenderTable() '定义一个表格对象
rt.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
rt.Width = 70 '表格宽度为70mm
rt.Style.Spacing.All = 2 '和其他对象之间的间隔为2mm
rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never '避免垂直换页的时候,表格被分割成两部分.
rt.Cols(0).Width = 20
rt.cells(0,1).Text = "姓名"
rt.Cells(0,2).Text = r("姓名")
rt.Cells(1,1).Text = "部门"
rt.Cells(1,2).Text = r("部门")
rt.Cells(2,1).Text= "职务"
rt.cells(2,2).Text = r("职务")
rt.Cells(0,0).SpanRows = 3
Bar.Code = r("地址")
rt.Cells(0,0).Image = bar.GetImage
doc.Body.Children.Add(rt) '将表格对象加入到
Next
Doc.Preview()