Foxtable(狐表)用户栏目专家坐堂 → [求助]客户端连接web数据源后无法保存数据


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

主题:[求助]客户端连接web数据源后无法保存数据

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


加好友 发短信
等级:婴狐 帖子:37 积分:653 威望:0 精华:0 注册:2012/5/20 21:47:00
  发帖心情 Post By:2019/7/12 14:03:00 [只看该作者]

不是表达式列,我现在又发现如果进行整张表保存 datatables().save无法保存,而如果逐行datarow.save却可以保存

 回到顶部
帅哥,在线噢!
有点蓝
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107024 积分:544351 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/12 14:06:00 [只看该作者]

使用的是哪个版本的Foxtable?更新到最新版试试

 回到顶部
帅哥哟,离线,有人找我吗?
panyongming
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:37 积分:653 威望:0 精华:0 注册:2012/5/20 21:47:00
  发帖心情 Post By:2019/7/12 14:09:00 [只看该作者]

是7.9版本
窗口按钮代码
DataTables("参数计算").ReplaceFor("值",Nothing,"来源表 is not null Or 公式 is not null")
DataTables("参数计算").ReplaceFor("字符值","","来源表 is not null Or 公式 is not null")
Dim dr As Row = Tables("输入参数").Current
DataTables("货物密度").ReplaceFor("选择",0,"选择 = 1")

Dim drmd As DataRow '货物密度
If dr("货物名称") = "蛋类" AndAlso dr("冷库温度") < -2 Then
    drmd = DataTables("货物密度").Find("名称 = '冰蛋'")
Else
    drmd = DataTables("货物密度").Find("名称 = '" & dr("货物名称") & "'")
End If
If drmd IsNot Nothing Then
    drmd("选择") = 1
End If

'新建临时表
Dim dtb As New DataTableBuilder("参数计算ls")
For Each drjs As DataRow In DataTables("参数计算").DataRows '临时表添加列,列名为参数计算表各行代码
    If drjs("值类型") = 0 Then
        dtb.AddDef("" & drjs("代码") & "", Gettype(Double))
    Else
        dtb.AddDef("" & drjs("代码") & "", Gettype(String))
    End If
Next
dtb.Build()
Dim drjsn As Row = Tables("参数计算ls").AddNew

Dim maxi As Integer = DataTables("参数计算").Compute("Max(计算顺序)")'最大计算顺序号
For i As Integer = 1 To maxi
    Dim drjss As List(of DataRow)
    '动态设置来源列
    drjss = DataTables("参数计算").Select("动态设置来源列 is not null and 计算顺序 = " & i)
    If drjss.Count > 0 Then
        For Each drjs As DataRow In drjss
            drjs("来源列") = drjsn("" & drjs("动态设置来源列") & "")'将计算值填入参数计算表
        Next
    End If
    '根据来源列设置值
    drjss = DataTables("参数计算").Select("计算顺序 = " & i)
    For Each drjs As DataRow In drjss
        If drjs.IsNull("来源表") = False And drjs.IsNull("来源列") = False And drjs.IsNull("动态设置行值") Then '值列查找设置代码
            Dim drdm As DataRow = DataTables("" & drjs("来源表") & "").Find("选择 = 1")
            If drdm IsNot Nothing Then
                If drjs("值类型") = 0 Then
                    drjs("值") = drdm("" & drjs("来源列") & "")
                Else
                    drjs("字符值") = drdm("" & drjs("来源列") & "")
                End If
            
            End If
        End If
        If drjs.IsNull("来源表") = False And drjs.IsNull("来源列") = False And drjs.IsNull("动态设置行值") = False Then '值列查找设置代码
            Dim drdm As DataRow = DataTables("" & drjs("来源表") & "").Find("" & drjs("设置选择行") & " = '" & drjsn("" & drjs("动态设置行值") & "") & "'")'根据动态行值设置
            If drdm IsNot Nothing Then
                If drjs("值类型") = 0 Then
                    drjs("值") = drdm("" & drjs("来源列") & "")
                Else
                    drjs("字符值") = drdm("" & drjs("来源列") & "")
                End If
            End If
        End If
        '将参数计算表各代码值填入临时表新增行的对应列
        If drjs("值类型") = 0 Then
            drjsn("" & drjs("代码") & "") = drjs("值")
        Else
            drjsn("" & drjs("代码") & "") = drjs("字符值")'
        End If
        drjs.Save
    Next
    '根据公式设置值
    drjss = DataTables("参数计算").Select("计算顺序 = " & i & " And 公式 Is not null")
    If drjss.Count > 0 Then
        For Each drjs As DataRow In drjss
            drjsn("" & drjs("代码") & "") = Eval(drjs("公式"),drjsn)'根据公式计算
            If drjs("值类型") = 0 Then
                drjs("值") = drjsn("" & drjs("代码") & "")'将计算值填入参数计算表
            Else
                drjs("字符值") = drjsn("" & drjs("代码") & "")'
            End If
            drjs.Save
        Next
    End If
Next

 回到顶部
帅哥,在线噢!
有点蓝
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107024 积分:544351 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/12 14:50:00 [只看该作者]

意思是drjs.Save这种可以保存,然后DataTables("参数计算").Save不能保存?

 回到顶部
帅哥哟,离线,有人找我吗?
panyongming
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:37 积分:653 威望:0 精华:0 注册:2012/5/20 21:47:00
  发帖心情 Post By:2019/7/12 15:00:00 [只看该作者]

是的,DataTables("参数计算").Save 保存不起作用

 回到顶部
帅哥,在线噢!
有点蓝
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107024 积分:544351 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/12 15:21:00 [只看该作者]

我测试没有问题。联系客服远程看看

 回到顶部
总数 16 上一页 1 2