dim rr as row = tb.Rows(0)
For c As Integer = 0 To tb.Cols.Count -1 '逐列设置和填入内容
If tb.Cols(c).Visible Then
rt.Cols(cnt).Width = tb.Cols(c).PrintWidth '列宽等于实际列宽
If tb.Cols(c).IsNumeric OrElse tb.Cols(c).IsDate Then '如果是数值或日期列
rt.Cols(cnt).Style.TextAlignHorz = prt.AlignHorzEnum.Right '数据水平靠右
End If
rt.Cells(0, cnt).Text = rr(c)
cnt = cnt + 1
End If
Next