For Each region As String In Regions
rm = new prt.RenderEmpty \'定义一个新的空对象
rm.BreakBefore = prt.BreakEnum.Page \'打印前换页
doc.Body.Children.Add(rm)
rx = New prt.RenderText
rx.Style.Font = New Font("黑体", 16, FontStyle.Bold) \'
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 2
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rx.Text = region & "班数人数统计报表"
doc.Body.Children.Add(rx)
rx = New prt.RenderText
rx.Style.Font = New Font("宋体", 10, FontStyle.Bold) \'
rx.Style.Spacing.Bottom = 2
rx.Style.TextAlignHorz = prt.AlignHorzEnum.right
rx.Text = "报表日期:" & Date.Today
doc.Body.Children.Add(rx)
rt = New prt.RenderTable
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中
rt.Style.GridLines.All = New prt.LineDef(0.3,Color.black)
rt.Rows(0).Height=10
rt.Style.Font = New Font("宋体", 7)
Rows = tbl.DataTable.Select("[学校名称] =\'" & region & "\' and (" & iif(tbl.Filter>"", tbl.Filter, "1=1") & ")")
Dim hd As Integer = tbl.HeaderRows \'获得表头的层数
tbl.CreateReportHeader(rt,true) \'生成表头,包括所有列
For c As Integer = 0 To tbl.Cols.Count -1
rt.Cells(0,c).Text = tbl.Cols(c).Name
Dim r As Integer
For r = 0 To Rows.Count -1
rt.Rows(r+hd).height = 6
rt.Cells(r+hd,c).Text = rows(r)(tbl.Cols(c).Name)
Next
Next
rt.RowGroups(0, tbl.HeaderRows).Header = prt.TableHeaderEnum.All
doc.Body.Children.Add(rt)
Next
doc.preview()
请问老师:多层表头表,在做成报表时,报表的第一行显示不对,哪里有问题,请问该如何改,谢谢