以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码错了,怎么改?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=115243)

--  作者:求生
--  发布时间:2018/3/3 16:39:00
--  代码错了,怎么改?
大神帮忙看下,代码出错了,怎么改

Select Case e.DataCol.Name
    Case "上次欠款","上货金额","退货金额","还款金额","欠款金额"
        Dim dr As DataRow
        Dim drs As List(of DataRow)
        dr = e.DataTable.Find("[_SortKey] < " & e.DataRow("_SortKey"), "[_SortKey] Desc") 
        If dr Is Nothing Then 
            e.DataRow("欠款余额") = e.DataRow("上次欠款") + e.DataRow("上货金额")-e.DataRow("退货金额")- e.DataRow("还款金额")
            dr = e.DataRow
        End If
        drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey"), "[_SortKey]")
        For i As Integer = 1 To drs.Count - 1 
            drs(i)("欠款余额") = drs(i-1)("上次欠款") + drs(i)("上货金额")  - drs(i)("退货金额") - drs(i)("还款金额")
        Next    
End Select

--  作者:有点蓝
--  发布时间:2018/3/3 16:51:00
--  
出什么错?上传实例测试
--  作者:求生
--  发布时间:2018/3/3 18:02:00
--  
不能累计
--  作者:求生
--  发布时间:2018/3/3 18:02:00
--  
不能累计
--  作者:有点甜
--  发布时间:2018/3/4 15:07:00
--  
以下是引用求生在2018/3/3 18:02:00的发言:
不能累计

 

你做的项目发上来测试。