我用下面的代码实现按年度统计,预览后,不报错,也不生成统计表,请问如何修改?请指教,谢谢!Dim cb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim g As New GroupTableBuilder("统计表1", DataTables("补助发放表"))
Dim dt As fxDataSource
g.Groups.AddDef("所属期", DateGroupEnum.Year, "年")
g.Groups.AddDef("姓名")
g.Groups.AddDef("账号")
g.Groups.AddDef("开户行")
g.Totals.AddDef("本期应发总额")
g.Totals.AddDef("市级补助")
g.Totals.AddDef("本级补助")
g.VerticalTotal = True
g.Decimals = 2
dt = g.BuildDataSource()
Tables("按照年度统计_Table1").DataSource = dt '将统计结果绑定到Table
Tables("按照年度统计_Table1").Filter="年='cb1.text'"
Tables("按照年度统计_Table1").SetColVisibleWidth("年|60|姓名|80|账号|160|开户行|160|本期应发总额|80|市级补助|80|本级补助|80")
Tables("按照年度统计_Table1").ExtendLastCol = True
For Each C As Col In Tables( "按照年度统计_Table1").ColS '字段居中对齐
c.TextAlign = TextAlignEnum.Center
Next