'If Tables.contains("删除来货单号临时表1")=True Then
'DataTables("删除来货单号临时表1").DataRows.Clear
'End If
Dim Filter As String
Dim d1 As Date=e.Form.controls("DateTimePicker1").value
Dim d2 As Date=e.Form.controls("DateTimePicker2").value
Dim gs As String=e.Form.controls("DropBox1").value
If d2<>Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "录入日期=#"& d2 &"#"
End If
If d1<>Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "清单日期=#"& d1 &"#"
End If
If gs<>"" Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "配送公司 like '%" & gs & "%'"
End If
Dim bd1 As New SQLGroupTableBuilder("删除来货单号临时表1","计划来货登记表")
Dim dt1 As fxDataSource
bd1.FromServer = True
bd1.filter=filter
bd1.Groups.AddDef("来货单号")
bd1.Groups.AddDef("清单日期", DateGroupEnum.None)
bd1.Groups.AddDef("录入日期", DateGroupEnum.None)
bd1.Groups.AddDef("配送公司")
bd1.Totals.AddExp("采购金额_正常","来货数量*采购价")
dt1 = bd1.BuildDataSource()
Dim bd2 As New SQLGroupTableBuilder("删除来货单号临时表2","科室急需提前送货表")
Dim dt2 As fxDataSource
bd2.FromServer = True
bd2 .filter=filter
bd2 .Groups.AddDef("来货单号")
bd2 .Groups.AddDef("清单日期", DateGroupEnum.None)
bd2 .Groups.AddDef("录入日期", DateGroupEnum.None)
bd2 .Groups.AddDef("配送公司")
bd2.Totals.AddExp("采购金额_急送","数量*采购价")
dt2 = bd2.BuildDataSource()
Dim nms As String() ={"来货单号","清单日期","录入日期","配送公司"}
dt1.Combine(nms,dt2,nms) '将销售统计数据组合到进货统计数据
dt1.Show("删除来货单号临时表1") '显示统计结果
e.Form.controls("Table1").Table.DataSource = dt1
With e.Form.controls("Table1").Table.DataTable.DataCols '用表达式列计算库存数据
.Add("总金额",Gettype(Double), "IsNull([采购金额_正常],0) + ISNULL([采购金额_急送],0)")
End With
'e.Form.controls("Table1").Table.AutoSizeCols()
上面是一个按钮的代码:是根据录入日期,清单日期、配送公司为条件,生成的表。发现一个问题,只要连续点击三次就会出现错误提示:“表 删除来货单号临时表1 不属于此 DataSet。” 请问老师到底是什么原因?