Dim doc As New PrintDoc() '定义一个报表
Dim bar As New BarCodeBuilder() '定义一个条码
Dim bar0 As New BarCodeBuilder() '定义一个条码
Dim img0 As New prt.RenderImage() '定义一个图片对象
Dim img As New prt.RenderImage() '定义一个图片对象
Dim img1 As New prt.RenderImage() '定义一个图片对象
Dim i1 As Integer=1
For i0 As Integer=1 To 4 Step 1 '列号,共4列产品条码
For l1 As Integer=4 To 12 Step 1 '行号,共9行产品条码
Dim ra & i1 As New prt.RenderArea '增加一个容器------------------------产品的第一个条码
Dim bar & i1 As New BarCodeBuilder() '定义一个条码
bar & i1 .Symbology = Barpro.symbology.Code128
bar & i1 .BarRatio = 0.1 '宽宿窄比例
bar & i1 .BarWidth = 0.256 '条码宽度
bar & i1 .BarHeight = 4.9 '条码高度
bar & i1 .Code = r0("bar_n" & i1).trim()
img1 = new prt.RenderImage
img1.Image = bar & i1 .GetImage
ra & i1.Children.Add(img1) '添加到容器中
rt.Cells(l1,i0).RenderObject = ra & i1 '把这个容器写到第4行第0列
i1 +=1
Next
Next
doc.Body.Children.Add(rt) '将表格对象加入到报表中
Doc.Preview