如下图所示,多点击几次,总会出现这样的错误 。
此主题相关图片如下:无标题.png
Dim dn As String = "欠料汇总" & FromSn
FromSn += 1
If c2.Text > "" AndAlso c3.Text > "" Then
Dim g As New GroupTableBuilder(dn, dt)
'按年|按季|按月|按周|按天
Select Case c2.Text
Case "按年"
g.Groups.AddDef("上报日期", DateGroupEnum.Year, "年")
Case "按季"
g.Groups.AddDef("上报日期", DateGroupEnum.Year, "年")
g.Groups.AddDef("上报日期", DateGroupEnum.Quarter, "季")
Case "按月"
g.Groups.AddDef("上报日期", DateGroupEnum.Year, "年")
g.Groups.AddDef("上报日期", "月")
Case "按周"
g.Groups.AddDef("上报日期", DateGroupEnum.Year, "年")
g.Groups.AddDef("上报日期", "月")
g.Groups.AddDef("周")
Case "按天"
g.Groups.AddDef("上报日期", DateGroupEnum.Year, "年")
g.Groups.AddDef("上报日期", "月")
g.Groups.AddDef("上报日期", DateGroupEnum.Day, "日")
End Select
Select Case c3.Text
Case "采购"
g.Groups.AddDef("负责人")
Case "上报车间"
g.Groups.AddDef("车间")
End Select
' g.Totals.AddDef("数量")
g.Totals.AddDef("完成", AggregateEnum.Count, "上报批数")
g.Totals.AddDef("数量", AggregateEnum.Count, "上报批数")
g.Totals.AddDef("计划日期", AggregateEnum.Count, "回复批数")
g.Totals.AddDef("实际日期", AggregateEnum.Count, "完成批数")
g.Totals.AddDef("回复逾期", AggregateEnum.Count)
g.Totals.AddDef("逾期", AggregateEnum.Count)
g.Totals.AddDef("首复逾期", AggregateEnum.Count)
g.Totals.AddDef("终复逾期", AggregateEnum.Count)
g.Build()
Dim tb As Table = Tables(e.Form.Name & "_Table1")
tb.DataSource = DataTables(Dn)
Else
MessageBox.Show("请选择你需要统计的对象")
End If
[此贴子已经被作者于2017/6/13 21:32:29编辑过]