Dim nums1() As String={"sex","age","birth", _
"edu","workdate","politicalStatus", _
"retiredPost","title","leaOrRetire", _
"retireTime","proTecPost","partyTime", _
"organName","partyStanding","retiredDep"}
Dim nums2() As String={"性别","年龄","出生年月", _
"学历","参加工作日期","政治面貌", _
"离退休职务","享受待遇","状态", _
"离退休时间","专业技术职务","入党时间", _
"单位","党龄","部门"}
Dim b As New SQLCrossTableBuilder("统计表1","person")
b.C
For Each r As Row In Tables("统计1").Rows
If r.IsNull("分组列")=False Then
Dim index As Integer=Array.indexof(nums2,r("分组列"))
b.HGroups.AddDef(nums1(index),r("日期分组"),r("分组列"))'添加列用于水平分组
End If
Next
For Each r As Row In Tables("统计2").Rows
If r.IsNull("分组列")=False Then
Dim index As Integer=Array.indexof(nums2,r("分组列"))
If r.IsNull("日期分组")=False And r.IsNull("模式")=False Then
b.VGroups.AddDef(nums1(index),r("日期分组"), r("模式"))
ElseIf r.IsNull("日期分组")=False And r.IsNull("模式")=True Then
b.VGroups.AddDef(nums1(index),r("日期分组"))
ElseIf r.IsNull("日期分组")=True And r.IsNull("模式")=False Then
b.VGroups.AddDef(nums1(index),r("模式"))
Else
b.VGroups.AddDef(nums1(index)) '添加列用于垂直分组
End If
End If
Next
For Each r As Row In Tables("统计3").Rows
If r.IsNull("统计列")=False Then
Dim index As Integer=Array.indexof(nums2,r("统计列"))
b.Totals.AddDef(nums1(index), AggregateEnum.Count) '添加列用于统计
End If
Next
If e.Form.Controls("CheckBox1").Checked = True Then '水平方向生成汇总
b.HorizontalTotal = True
End If
If e.Form.Controls("CheckBox2").Checked = True Then '垂直方向生成汇总
b.VerticalTotal = True
End If
b.Build '生成统计表
此主题相关图片如下:1.png

老师,我的确定按钮的代码如上,
输入内容如图,
但是报错,请老师帮忙看一下