Dim d1 As Date = e.Form.Controls("统计开始日期").Value
Dim d2 As Date = e.Form.Controls("统计结束日期").Value
Dim d3 As Date = e.Form.Controls("年度期初").Value
Dim d4 As Date = e.Form.Controls("上年年末").Value
If d1 = Nothing Or d2 = Nothing Then
MessageBox.Show("起始或结束日期都不能为空!","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
End If
Dim g1 As New GroupTableBuilder("月度统计", DataTables("业务表")) \'客户查询 为Click按钮名称
g1.Filter = "日期<=#" & d2 & "# and 未报数量 <> 0 "\'"
Dim bb1 As fxDataSource
g1.Groups.AddDef("员工姓名")
g1.Groups.AddDef("礼品类别")
g1.Groups.AddDef("领而未报")
g1.Totals.AddDef("未报数量")
g1.VerticalTotal = True
g1.SubTotal = True
g1.Decimals = 2
g1.FromServer = True
g1.Build()
bb1 = g1.BuildDataSource()
Tables("业务管理_统计表").DataSource = g1.BuildDataSource()
e.Form.Controls("统计表").Visible = True
Tables("业务管理_统计表").cols("未报数量").DataCol.setFormat("#,###.0")
Tables("业务管理_统计表").SetColVisibleWidth("员工姓名|80|礼品类别|80|领而未报|80|未报数量|80")
代码为上面,仅是汇总统计,现在需要把零值的不统计在内,通实现吗?