这个代码是不是要在统计表中将所有涉及的列全部输入数据后才能显示.
这样?
Dim T2 As DataRow = e.DataRowDim Str As String
Str = "[IO] = '" & T2("IO") & "' And [口岸] = '" & T2("口岸") & "'And [色号] = '" & T2("色号") & "'And [色名] = '" & T2("色名") & "'And [运输方式] = '" & T2("运输方式") & "'and[包装]='" & T2("包装") & "'"
Select Case e.DataCol.Name
Case "IO","口岸","色号","色名","运输方式","包装"
T2("XS") = DataTables("装箱单").Compute("Sum(XS)",Str)
T2("S") = DataTables("装箱单").Compute("Sum(S)",Str)
T2("M") = DataTables("装箱单").Compute("Sum(M)",Str)
T2("L") = DataTables("装箱单").Compute("Sum(L)",Str)
T2("XL") = DataTables("装箱单").Compute("Sum(XL)",Str)
T2("XXL") = DataTables("装箱单").Compute("Sum(XXL)",Str)
T2("XXXL") = DataTables("装箱单").Compute("Sum(XXXL)",Str)
End Select
[此贴子已经被作者于2009-8-24 10:48:24编辑过]
以下是引用czy在2009-8-24 10:46:00的发言:这样?
Dim T2 As DataRow = e.DataRowDim Str As String
Str = "[IO] = '" & T2("IO") & "' And [口岸] = '" & T2("口岸") & "'And [色号] = '" & T2("色号") & "'And [色名] = '" & T2("色名") & "'And [运输方式] = '" & T2("运输方式") & "'and[包装]='" & T2("包装") & "'"
Select Case e.DataCol.Name
Case "IO","口岸","色号","色名","运输方式","包装"
T2("XS") = DataTables("装箱单").Compute("Sum(XS)",Str)
T2("S") = DataTables("装箱单").Compute("Sum(S)",Str)
T2("M") = DataTables("装箱单").Compute("Sum(M)",Str)
T2("L") = DataTables("装箱单").Compute("Sum(L)",Str)
T2("XL") = DataTables("装箱单").Compute("Sum(XL)",Str)
T2("XXL") = DataTables("装箱单").Compute("Sum(XXL)",Str)
T2("XXXL") = DataTables("装箱单").Compute("Sum(XXXL)",Str)
End Select
[此贴子已经被作者于2009-8-24 10:48:24编辑过]
C版,你的公式是不是放在装箱统计表中,我放入后显示全部为空?
C版我查过了,必须要将装箱统计中列输入全部输入和装箱单匹配的数据才能显示,但表达式是不需要的,请问这个有办法想吗?
另外我想问一下,如T2("XXXL") = DataTables("装箱单").Compute("Sum(XXXL)",Str)这句代码,我这个T2(XXXL)=DataTables("装箱单").Compute("Sum(XXXL)",Str)*(箱数)的,这个公式怎么写?
以下是引用blackzhu在2009-8-24 11:03:00的发言:
C版我查过了,必须要将装箱统计中列输入全部输入和装箱单匹配的数据才能显示,但表达式是不需要的,请问这个有办法想吗?
另外我想问一下,如T2("XXXL") = DataTables("装箱单").Compute("Sum(XXXL)",Str)这句代码,我这个T2(XXXL)=DataTables("装箱单").Compute("Sum(XXXL)",Str)*(箱数)的,这个公式怎么写?
应该是代码涉及的任一列有变动都会触发的。但要满足你设置的条件才能有结果。
箱数是当前表吗?
如果是当前表, *T2(”箱数“)
[此贴子已经被作者于2009-8-24 11:51:03编辑过]