Dim t As Table = Tables("松北所DMA分区统计表")
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)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "管理站"
g.Caption = "{0}"
t.SubtotalGroups.Add(g)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*"
g.Caption = "总计"
t.SubtotalGroups.Add(g)
t.Subtotal(True)
Dim r,r2 As Row
static pr As String
For i As Integer = t.Rows.Count(True) - 2 To 0 Step-1
r = t.Rows(i,True)
If r.IsGroup '如果是分组行
If r.Level = 0 Then
Dim f As String = "管理站 = '" & r("序号") & "'"
output.show(f)
pr = r("序号")
Dim v As String = " DMA小区:" & t.Compute("Count(小区编号)",f) & "个"
v = v & " 考核表:" & t.Compute("Sum(合计)",f) & "个"
v = v & " 单路表:" & t.Compute("Sum(单路)",f) & "个"
v = v & " 多路表:" & t.Compute("Sum(多路)",f) & "个"
r("序号") = "管理站:" & r("序号") & v
ElseIf r.Level = 1 Then
Dim f As String = "管理站 = '" & pr & "' and 分块 = '" & r("序号") & "'"
output.show(f)
Dim v As String = " DMA小区:" & t.Compute("Count(小区编号)",f) & "个"
v = v & " 考核表:" & t.Compute("Sum(合计)",f) & "个"
v = v & " 单路表:" & t.Compute("Sum(单路)",f) & "个"
v = v & " 多路表:" & t.Compute("Sum(多路)",f) & "个"
r("序号") = "管理站:" & pr & "-" & r("序号") & ":" & v
End If
End If
Next
r2 = t.Rows(t.Rows.Count(True) - 1,True)
r2("序号") = "松北所:总 计 DMA小区:" & t.Compute("Count(小区编号)","") & "个 考核表:" & t.Compute("Sum(合计)","") & "个 单路表:" _
& t.Compute("Sum(单路)","") & "个 多路表:" & t.Compute("Sum(多路)","") & "个"