以下代码有什么问题?
Dim t1 As Table = e.Form.Controls("Table1").Table
Dim t2 As Table = e.Form.Controls("Table2").Table
Dim Customer_ID1 As String = e.Form.Controls("Customer_ID1").value
Dim Material_ID1 As String =e.Form.Controls("Material_ID1").value
Dim Project_ID1 As String = e.Form.Controls("Project_ID1").value
Dim DataType1 As String = e.Form.Controls("DataType1").value
Dim CustGrp1 As String = e.Form.Controls("CustGrp1").value
Dim ck As WinForm.CheckedComboBox = e.Form.Controls("Items")
If ck.text = "" Then Return
Dim sql As String = "SELE CT " & ck.Value & ",ltrim(str(year(Period))) + '年' + ltrim(str(month(Period))) + '月' [Version],Sum([Value]) As [Value] FROM wms_SaOP Group By " & ck.Value & ",ltrim(str(year(Period))) + '年' + ltrim(str(month(Period))) + '月' "
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = sql
Dim data As DataTable = cmd.ExecuteReader()
Dim cols As String() = ck.Value.Split(",")
If Cols.Length <= 0 Then Return
Dim b As New CrossTableBuilder("统计表1",data )
For Each c As String In Cols
b.HGroups.AddDef(c,t1.Cols(c).Caption) '添加客户列用于水平分组
Next
b.VGroups.AddDef("Version") '添加产品列用于垂直分组
b.Totals.AddDef("Value") '添加数量列用于统计
Dim dt As DataTable = b.Build(True) '生成统计表
t2.DataSource = dt