Dim filter1 As String
filter1="客户名称= '" & e.Form.Controls("ComboBox1").value & "'" & " And 加工日期 >= #" & e.Form.Controls("startdate").value & "# " & " And 加工日期 <= #" & e.Form.Controls("enddate").value & "# "
Dim t As Table = Tables(e.form.Name & "_Table1")
Dim g As New sqlgroupTableBuilder("统计表1", "加工单")
g.C
g.Groups.AddDef("加工日期", "月份")
g.Groups.AddDef("款型及款号")
g.Totals.AddDef("件重")
g.Totals.AddDef("件数")
g.Totals.AddDef("单价")
g.Totals.AddDef("金额")
g.VerticalTotal = True
g.SubTotal = True
g.filter=filter1
''重新生成汇总
t.DataSource = g.BuildDataSource
Dim g1 As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g1 = New Subtotalgroup
g1.Aggregate = AggregateEnum.Sum
g1.GroupOn = "月份"
g1.TotalOn = "件数,金额"
g1.Caption = "{0}月 小计"
g1.DateGroup = DateGroupEnum.Month
t.SubtotalGroups.Add(g1)
g1 = New Subtotalgroup
g1.Aggregate = AggregateEnum.Sum
g1.GroupOn = "*"
g1.TotalOn = "件数,金额"
g1.Caption = "总计"
t.SubtotalGroups.Add(g1)
t.Subtotal()''
t.SetColVisibleWidth("月份|60|款型及款号|280|件重|100|件数|100|单价|100|金额|100")
t.DataTable.DataCols("金额").SetFormat("0.00")
t.Cols("月份").TextAlign = TextAlignEnum.Center