http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50080
rt.Style.Font = new Font("楷体", tb.Font.Size)
dim idx as integer = 0
For c As Integer = 0 To tb.Cols.Count -1 '逐列设置和填入内容
if tb.Cols(c).visible = false then continue for
rt.Cells(0,idx).Text = tb.Cols(c).Name '列名作为标题
rt.Cells(0,idx).Style.TextAlignHorz = prt.AlignHorzEnum.Center '标题内容水平居中
rt.Cols(idx).Width = tb.Cols(c).PrintWidth '列宽等于实际列宽
If tb.Cols(c).IsNumeric OrElse tb.Cols(c).IsDate Then '如果是数值或日期列
rt.Cols(idx).Style.TextAlignHorz = prt.AlignHorzEnum.Right '数据水平靠右
End If
For r As Integer = 0 To tb.Rows.Count -1 '开始填入该列内容
rt.Cells(r + 1, idx).Text = tb(r,c)
Next
idx += 1
Next