Dim doc As New PrintDoc '定义一个报表
Dim rs As New prt.RenderText()
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式
For i As Integer = 1 To Tables("表名").Current("份数")
Dim rt As New prt.RenderTable() '定义一个表格对象
rt.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
rt.Width = 70 '表格宽度为50mm
rt.Style.Spacing.All = 2 '和其他对象之间的间隔为2mm
rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never '避免垂直换页的时候,表格被分割成两部分.
rt.Cols(0).Width = 15
rt.cells(0,0).Text = "产品编号"
rt.cells(0,1).text = "YR-35"
rt.Cells(1,0).Text = "成份比例"
rt.Cells(2,0).Text = "纱支"
rt.Cells(3,0).Text = "密度"
rt.Cells(4,0).Text= "幅宽"
rt.cells(5,0).text = "克重"
rt.cells(6,0).Text = "备注"
rt.Cells(7,0).SpanCols =2
rt.cells(7,0).text = " 上海佑冉经贸发展有限公司"
rt.Rows(7).Style.BackColor = Color.LightGray
doc.Body.Children.Add(rt) '将表格对象加入到报表中
Next
Doc.Preview() '预览报表