Foxtable(狐表)用户栏目专家坐堂 → 麻烦看一下干嘛出错


  共有2142人关注过本帖树形打印复制链接

主题:麻烦看一下干嘛出错

帅哥哟,离线,有人找我吗?
wuchangke4
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:32 积分:286 威望:0 精华:0 注册:2018/7/8 7:44:00
麻烦看一下干嘛出错  发帖心情 Post By:2018/12/12 11:39:00 [显示全部帖子]

Select Case e.DataCol.name 
    Case "Lwg12","Lwg18","Lwg20","Lwg22","Lwg25","Lwg28","Lwg32" ,"lwg16"
      Dim sksumlwg As Double = 0
      Dim n1() As String = {"Lwg12","Lwg16","Lwg18","Lwg20","Lwg22","Lwg25","Lwg28","Lwg32"}
      For Each n As String In n1
        If e.DataTable.DataCols.contains(n)
          sksumlwg = sksumlwg + e.DataRow(n)
        End If
      Next
      e.DataRow("lwg") = sksumlwg
    Case "Gyg12","Gyg10","Gyg8","Gyg6"
      Dim sksumgyg As Double = 0
      Dim n2() As String = {"Gyg12","Gyg10","Gyg8","Gyg6"}
      For Each n As String In n2
        If e.DataTable.DataCols.contains(n)
          sksumgyg = sksumgyg + e.DataRow(n)
        End If
      Next
      e.DataRow("Gyg") = sksumgyg
End Select







Dim skdr As DataRow = e.DataRow '返回改变的行
Dim skdc As DataCol = e.DataCol '返回改变的列
Dim skdt As DataTable           '整个数据表
For Each skdt In DataTables     '遍历全部表
  If skdc.name="gcbw" And skdt.name = skdr("gcbw") Then  '统计工程与明细工程一致
    For Each skdtw As DataCol In DataTables(skdt.name).dataCols  '在各个工程表中遍历所有列
      Select Case skdtw.name     '与统计列相一致时,汇表填值
        Case "lwg32"
          skdr("lwg32") = skdt.compute("sum(lwg32)")
        Case "lwg28"
          skdr("lwg28") = skdt.compute("sum(lwg28)")
        Case "lwg25"
          skdr("lwg25") = skdt.compute("sum(lwg25)")
        Case "lwg22"
          skdr("lwg22") = skdt.compute("sum(lwg22)")
        Case "lwg20"
          skdr("lwg20") = skdt.compute("sum(lwg20)")
        Case "lwg16"
          skdr("lwg16") = skdt.compute("sum(lwg16)")
        Case "lwg12"
          skdr("lwg12") = skdt.compute("sum(lwg12)")
        Case "gyg12"
          skdr("gyg12") = skdt.compute("sum(gyg12)")
        Case "gyg10"
          skdr("gyg10") = skdt.compute("sum(gyg10)")
        Case "Gyg8"
          skdr("Gyg8") = skdt.compute("sum(Gyg8)")
        Case "Scg"
          Skdr("scg") = skdt.compute("sum(scg)")
        Case "TongC30"
          Skdr("TongC30") = skdt.compute("sum(TongC30)")
        Case "Jinxing"
          Skdr("Jinxing") = Skdt.compute("sum(Jinxing)")
        Case "TongC40"
          Skdr("TongC40") = Skdt.compute("sum(TongC40)")
该行出错         Skdr("DTC400") =  skdt.Compute("Sum(TongC40)","[gcbw] = '" & skdt.name  & "'[Dungao] > 0 And [Dungao] <= 25 '") 

          output.show("25米以下:" & skdr("DTC400")) 
          Skdr("DTC401")  = skdt.Compute("Sum(TongC40)", "[Dungao] > 25 And [Dungao] <= 50 "  )  
output.show("25米至50米:" & skdr("DTC401"))            
          Skdr("DTC402")  = skdt.Compute("Sum(TongC40)", "[Dungao] > 50 And [Dungao] <= 75 "  ) 
output.show("50米至75米:" & skdr("DTC402")) 
          Skdr("DTC403")  = skdt.Compute("Sum(TongC40)", "[Dungao] > 75 And [Dungao] <= 100 "  ) 
output.show("50米至100米:" & skdr("DTC403")) 


        Case Else
      End Select
     Next
  End If
Next

 回到顶部