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