Dim idx As Integer = DataTables("兑付明细表").SQLCompute("max([_identify])")
DataTables("兑付明细表").LoadFilter ="[_identify] >" & idx
DataTables("兑付明细表").Load()
Dim t As Table = Tables("兑付明细表")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = False
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "银行类别"
g.TotalOn = "借款金额,应结金额"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)
t.Subtotal()
'
Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim Count As Integer = 0
For Each Col As Col In t.Cols
rt.Cells(0,Count).Text = Col.Name
For r As Integer = 0 To t.Rows.Count - 1
rt.Cells(r +1,Count).Text = t.Rows(r)(Col.Name)
Next
Count = Count + 1
Next
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray)
rt.CellStyle.Spacing.All = 1
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center
doc.Body.Children.Add(rt)
doc.Preview()
老师你好!我试着并接了上述代码,生成的表中有合计数,但预览的时候没有,请问如何修改?谢谢!!