这样试试
''获取统计控件的值
Dim chuiZhi As String = e.Form.Controls("chuiZhi").text
Dim chuiZhi1 As String = e.Form.Controls("chuiZhi1").text
If chuiZhi Is Nothing Then
e.Form.Controls("chuiZhi").Error="请选择垂直分组列"
Return
Else If chuiZhi = chuiZhi1 Then
e.Form.Controls("chuiZhi1").Error="垂直分组列1和2不允许重复"
Return
Else
chuiZhi = chuiZhi.Replace(" ","")
chuiZhi1 = chuiZhi.Replace(" ","")
End If
Dim b As New CrossTableBuilder("统计表1", DataTables("时间节点_Table1"))
b.HGroups.AddDef("离退休单位") '添加单位列用于水平分组
If chuiZhi1 = "" Then
b.VGroups.AddDef(chuiZhi,chuiZhi & "_{0}" ) '添加垂直分组
Else
b.VGroups.AddDef(chuiZhi) '添加垂直分组
b.VGroups.AddDef(chuiZhi1) '添加垂直分组
End If
……