-- 作者:fyj0326
-- 发布时间:2011/6/9 12:48:00
-- 库存按月分组后库存小计栏不正确,
代码中:
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 g.upto = True t.SubtotalGroups.Add(g)
t.Subtotal()
For i As Integer = 0 To CurrentTable.Rows.Count(True) - 1 Dim r As Row = CurrentTable.Rows(i,True) If r.IsGroup r("库存") = r("入库")- r("出库") End If Next
上图在分组计算后,3月,4月,5月的库存小计栏不正确,
代码如何写才能得出下图库存小计中的红色字体的数据呢?
此主题相关图片如下:20110609-截图 4.png

此主题相关图片如下:20110609-截图 5.png

|