可以的,不过要注意取值的列,以Excel报表.table为例
Dim t As Table = Tables("订单")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "客户"
g.Caption = "{0}"
t.SubtotalGroups.Add(g)
t.Subtotal()
Dim r As Row
For i As Integer = 0 To t.Rows.Count(True) - 1
r = t.Rows(i,True)
If r.IsGroup '如果是分组行
Dim f As String = "客户 = '" & r("产品") & "'"
Dim v As String = " 订单数:" & t.Compute("Count(日期)",f)
v = v & " 订购数量:" & t.Compute("Sum(数量)",f)
v = v & " 订购金额:" & t.Compute("Sum(金额)",f)
r("产品") = "客户:" & r("产品") & v
End If
Next