Dim g As New CrossTableBuilder("统计表1", DataTables("小流域统计")) g.HGroups.AddDef("年度") g.VGroups.AddDef("措施") g.Totals.AddDef("数量", "数量") g.HorizontalTotal = True g.VerticalTotal = True g.Build() Dim t As Table = Tables("统计表1") Dim sum As Double = 0 For i As Integer = 1 To t.Cols.count-2 Dim fdr As DataRow = DataTables("小流域统计").Find("措施='" & t.Cols(i).Caption & "'") If fdr IsNot Nothing AndAlso fdr("单位") <> "亩" Then sum += t.Rows(t.Rows.count-1)(i) t.Rows(t.Rows.count-1)(i) = Nothing End If Next t.Rows(t.Rows.count-1)(t.Cols.count-1) -= sum MainTable = t
|