Dim b As New SQLCrossTableBuilder("统计表1","财务流水账")
b.ConnectionName = _conn
b.HGroups.AddDef("创建时间",DateGroupEnum.month,"月") '添加日期列用于垂直分组,按年分组
b.VGroups.AddDef("财务科目") '添加客户列用于水平分组
b.Totals.AddDef("付款金额") '添加数量列用于统计
b.HorizontalTotal = True
b.VerticalTotal = True
b.Filter = "有效性='有效' and 责任部门='销售部‘ And year(创建时间)=2019"
b.Subtotal = True
Tables(e.form.name & "_table1").DataSource = b.Build
窗口表table1不显示垂直方向生成的汇总,需单独计算下垂直方向的汇总?
已解决:
With Tables(e.form.name & "_table1")
For Each c As Col In .cols
If c.Caption <> "月" Then
.Cols(c.name).GrandTotal = True
End If
Next
.GrandTotal = True '显示合计模式
End With
[此贴子已经被作者于2019/1/9 19:57:45编辑过]