Dim cnt As Integer
Dim tbl As Table = Tables("表A")
Dim drs As List(Of DataRow)
Dim pds As List(Of String) = tbl.DataTable.GetValues("")
rt.Style.Font = New Font("宋体", 11, FontStyle.Bold) '设置字体
rt.Style.GridLines.All = New prt.LineDef(0.3,Color.black)
rt.CellStyle.Spacing.All = 1
rt.Style.Font = tbl.Font
For c As Integer = 0 To tbl.Cols.Count - 1 '生成列标题
rt.Cells(0,c).Text = tbl.Cols(c).Name
rt.Cols(c).Width = tbl.Cols(c).PrintWidth
rt.Style.TextAlignVert = prt.AlignHorzEnum.Center
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
Next
For Each pd As String In pds '分产品打印
For Each dr As DataRow In drs '逐行打印此产品的订单
cnt = rt.Rows.Count
For c As Integer = 0 To tbl.Cols.Count - 1
rt.Cells(cnt, c).Text = dr(tbl.Cols(c).Name)
Next
Next
cnt = rt.Rows.Count
Next
这样的报表,能用这种方法打印吗?如果能,怎么改一下?