Dim tb As Table = Tables("ZDINFO.JZXINFO")
Dim ColNames As String() = New String(){"ZDNUM", "QDH","ZDH", "LEN", "JZXLB", "JZXWZ"}
'rt.Style.GridLines.All = New prt.Linedef(Color.red)
rt.CellStyle.Spacing.All = 1
rt.Style.GridLines.All = New prt.Linedef(Color.black)
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
'doc.Body.Children.Add(rt) '将表格对象加入到报表中
rt.CellStyle.Spacing.All = 1 '内容距离网格线1毫米
rt.cells(0,0).Text = "界址标示表" '设置第一行第一个单元格的内容
rt.cells(0,0).SpanCols = 19 '合并第一行前三个单元格
rt.cells(1,0).Text = "界址点号"
rt.Cells(1,0).SpanRows = 2 '
rt.cells(1,1).Text = "界标种类"
rt.Cells(1,1).SpanCols = 5'
rt.cells(2,1).Text = "钢钉"
rt.cells(2,2).Text = "水泥桩"
rt.cells(2,3).Text = "喷涂"
rt.Cells(1,6).SpanRows = 2
rt.cells(1,6).Text ="界址间距(m)"
rt.cells(1,7).SpanCols = 8
rt.cells(1,7).Text ="界址线类别"
rt.cells(2,7).Text="界址线"
rt.cells(2,8).Text="墙壁"
rt.cells(2,9).Text="屋檐"
rt.cells(2,10).Text="围墙"
rt.cells(2,11).Text="道路"
rt.cells(2,12).Text="沟渠"
rt.cells(2,13).Text="坎"
rt.cells(2,14).Text="两点连线"
rt.cells(1,15).Text="界址线位置"
rt.cells(1,15).SpanCols = 3
rt.cells(2,15).Text="内"
rt.cells(2,16).Text="中"
rt.cells(2,17).Text="外"
rt.cells(1,18).Text="说明"
Dim leibie As Integer
Dim weizhi As Integer
For Each r As Row In tb.Rows
Select Case r("JZXLB")
Case "界址线"
leibie = 7
Case "墙壁"
leibie = 8
Case "屋檐"
leibie = 9
Case "围墙"
leibie = 10
Case "道路"
leibie = 11
Case "沟渠"
leibie = 12
Case "坎"
leibie = 13
Case "两点连线"
leibie = 14
Case Else
leibie = 14
End Select
Select Case r("JZXWZ")
Case "内"
weizhi = 15
Case "中"
weizhi = 16
Case "外"
weizhi = 17
Case Else
weizhi = 17
End Select
'rt.Cells(4,c).Text = ColNames(c)
'rt.Cols(c).Width = tb.Cols(ColNames(c)).PrintWidth
rt.Cells(3+r.Index, leibie).Text = "√"
rt.Cells(3+r.Index, weizhi).Text = "√"
rt.Cells(3+r.Index, 3).Text= "√"
rt.Cells(3+r.Index, 0).Text = r("QDH")
rt.Cells(3+r.Index, 6).Text = r("jzx_len")
Next
rt.RowGroups(0,3).Header = prt.TableHeaderEnum.All '前两行作为表头
'rt.RowGroups(0,2).Style.BackColor = Color.LightGray '前两行的颜色设为灰色
'rt.RowGroups(3,1).DataBinding.DataSource = BindTables("ZDINFO.JZXINFO")'
doc.Body.Children.Add(rt)
Doc.Preview() '预览报表