在下面代码中如何使库存的累计也为36,而不是软件生成的库存累计为222呢?
Dim t As Table = Tables("例子二")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "日期"
g.TotalOn = "入库,出库,库存"
g.Caption = "{0}月 小计"
g.DateGroup = DateGroupEnum.Month
t.SubtotalGroups.Add(g)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "日期"
g.TotalOn = "入库,出库,库存"
g.Caption = "{0}月 累计"
g.DateGroup = DateGroupEnum.Month
t.SubtotalGroups.Add(g)
With CurrentTable
.Rows(.Rows.count,True)("库存") = .Rows(.Rows.count,True)("入库")-.Rows(.Rows.count,True)("出库")
End With