Dim Bar As New BarCodeBuilder
Dim img As prt.RenderImage
Bar.Symbology = Barpro.Symbology.Code128
Bar.Code = "75376451448390"
Bar.BarWidth = 0.5
Bar.BarRatio = 3
Bar.BarHeight = 9
Bar.QuietZoneWidth = 2
Bar.Font = New Font("微软雅黑",9,FontStyle.Bold)
Bar.TextFont = New Font("微软雅黑",9,FontStyle.Bold)
img = new prt.RenderImage
img.Image = bar.GetImage
'rt.Cells(4,4).Image = img
'
Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
doc.Body.Children.Add(rt) '将表格对象加入到报表中
rt.Style.GridLines.All = New prt.Linedef(Color.DarkGray) '将表格的颜色设为深灰色
rt.Rows.Count = 3 '设置行数
rt.Cols.Count = 3 '设置列数
rt.Width = 60 '设置表格的宽度
rt.Height = 60 '设置表格的高度
rt.Cells(0,0).RenderObject = img '将单元格内容设置为图片对象rm
Doc.Preview() '预览报表