Dim dst1 As Table = Tables("月生产报表")
Dim dr1 As Row = dst1.Current
Dim dst2 As Table = Tables("月生产报表")
Dim cmd As New SQLCommand
Dim cbox As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Select Case cbox.text
Case "全部"
cmd.CommandText = "execute CYMXA '1900-1-1','" & dr1("输入日期") & "'"
Case "近6笔"
cmd.CommandText = "execute CYMXB '" & dr1("输入日期") & "'"
Case "近一月"
cmd.CommandText = "execute CYMXA '" & today.AddMonths(-1) & "','" & dr1("输入日期") & "'"
Case "近三月"
cmd.CommandText = "execute CYMXA '" & today.AddMonths(-3) & "','" & dr1("输入日期") & "'"
Case "近一年"
cmd.CommandText = "execute CYMXA '" & today.AddYears(-1) & "','" & dr1("输入日期") & "'"
Case "近三年"
cmd.CommandText = "execute CYMXA '" & today.AddYears(-3) & "','" & dr1("输入日期") & "'"
End Select
dst2.DataSource = cmd.ExecuteReader()
dst2.Sort = "输入日期"
For i As Integer=1 To dst2.count
Dim dr As Row = dst2.Rows(i-1)
dr("生产批号") = "" & i
Next
dst2.AutoSizeCols()