代码
Dim c1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim c2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim sid As Integer
Dim eid As Integer
If c1.Text = Nothing Then
sid = 1
Else
sid = val(c1.Text)
End If
If c2.Text = Nothing Then
eid = 12
Else
eid = val(c2.Text)
End If
DataTables("表C").DataRows.Clear
Dim cvstr As String = "姓名|98"
For Each name As String In DataTables("表A").GetValues("姓名", "", "_Sortkey")
Dim ndr As DataRow = DataTables("表C").AddNew
ndr("姓名") = name
For i As Integer = sid To eid
Dim filter As String = "月份 = '" & i & "' and 姓名 = '" & name & "'"
ndr("月" & i) = DataTables("表A").Compute("sum(月工资)", filter)
Next
Next
For i As Integer = sid To eid
cvstr &= "|月" & i & "|98"
Next
e.Form.Controls("Table1").Table.SetColVisibleWidth(cvstr)