Dim rb1 As New prt.RenderTable() '定义一个表格对象
With rb1
'.DataBinding.DataSource = BindTables("B02订单报价.B02订单管理") '将rt绑定到订单表
.x = 10
.y = "Prev.Bottom + 10"
.Style.GridLines.All = New Prt.LineDef (0.4, Color.Black)
.Style.GridLines.Left = New Prt.LineDef (0,Color.Transparent)
.Style.GridLines.Right = New Prt.LineDef (0,Color.Transparent)
.Style.GridLines.Horz = new Prt.LineDef(0.1,Color.Black)
.Style.GridLines.Vert = new Prt.LineDef(0.1,Color.Black)
.Cols.Count = 6 '设置列数
.Cols(0).Width = 40 '设置列宽
.Cols(1).Width = 50 '设置列宽
.Cols(2).Width = 50 '设置列宽
.Cols(3).Width = 10 '设置列宽
.Cols(4).Width = 20 '设置列宽
.Style.Font = f11 '字体设置
.Style.TextAlignHorz = prt.AlignHorzEnum.Center '所有文本内容中间对齐
.Style.TextAlignVert = prt.AlignVertEnum.Bottom '所有文本内容下部对齐
Dim st As String() = {"品名" & Chr(13) & "Description","规格" & Chr(13) & "Specification","序列号" & Chr(13) & "Series Number","单位" & Chr(13) & "Unit","价格" & Chr(13) & "Price","备注" & Chr(13) & "Remark"}
For i As Integer = 0 To 5
Dim rx As New prt.RenderText
rx.text = st(i)
.Cells(0, i).RenderObject = rx
Next
.Rows.Count = 9 '设置行数
.Rows(0).Height = 9
For i As Integer = 1 To 8
.Rows(i).Height = 6 '设置行高
Tables("B02订单报价.B02订单管理").Position = i - 1
For x As Integer = 0 To 5
Dim rx As New prt.RenderText
Select Case i
Case 0
rx .text = "[Fields!开piao项目名称.Value]"
.Cells(0, 0).RenderObject = rx
Case 1
rx .text = "[Fields!规格型号.Value]"
.Cells(0, 0).RenderObject = rx
Case 2
rx .text = "[Fields!SN编码.Value]"
.Cells(0, 0).RenderObject = rx
Case 3
rx .text = "[Fields!单位.Value]"
.Cells(0, 0).RenderObject = rx
Case 4
rx .text = "[Fields!单价.Value]"
.Cells(0, 0).RenderObject = rx
Case 5
rx .text = "[Fields!备注.Value]"
.Cells(0, 0).RenderObject = rx
End Select
Next
Next
doc.Body.Children.Add(rb1) '将表格对象加入到报表中