以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  SQL后台取值  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=133814)

--  作者:zoyong
--  发布时间:2019/4/21 10:54:00
--  SQL后台取值
SQLTable表

Dim r As Row = Tables(e.form.name & "_Table1").Current
        Dim cmd As New SQLCommand
        \'Dim nm As String  = r("立项编号")
        Dim nm As String  = r("项目名称")
        Dim dt As DataTable
        Dim Cols1() As String = {"项目名称","立项编号","简码","资质","区域"}  \'原数据
        Dim Cols2() As String = {"项目名称","立项编号","简码","资质","区域"}  \'目标数据
        cmd.C
        cmd.CommandText = "S ELECT * From {XM_在建项目} Where 项目名称 = \'" & nm & "\'"
        If cmd.ExecuteScalar > 0 Then
            Messagebox.Show("在建项目已经存在【" & r("项目名称")  & "】","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Exit Function
        End If
        dt = cmd.Execu teReader(True)
        For Each dr1 As DataRow In dt.DataRows
            MessageBox.Show(1)   \'不行
            Dim dr2 As DataRow = DataTables("XM_在建项目").AddNew()
            MessageBox.Show(2)   \'不行
            For i As Integer = 0 To Cols1.Length -1
                dr2(Cols2(i)) = dr1(Cols1(i))                
            Next
            MessageBox.Show(3)   \'不行
            dr2.Save   \'保存新增数据            
        Next

红色区域代码无效,大神帮忙看看
[此贴子已经被作者于2019/4/21 11:03:26编辑过]

--  作者:zoyong
--  发布时间:2019/4/21 11:01:00
--  
开标时间控件输入2019-04-21 09:30  离开控件就变成2019-04-21 00:00   

窗口动态控件   
开标时间控件DateTimePicker型   SQL类型datetime

录入窗口afterload
Dim dp1 As WinForm.DateTimePicker = e.Form.Controls("开标时间")
dp1.DateTimeFormat = DateTimeFormatEnum.DateTime      \'长日期格式


主窗口afterload
Tables(e.Form.name & "_table1").Cols("开标时间").SetDateTimeFormat(DateTimeFormatEnum.DateTime)      \'转换长日期
[此贴子已经被作者于2019/4/21 11:03:57编辑过]

--  作者:有点色
--  发布时间:2019/4/21 17:52:00
--  

改成比如

 

        cmd.CommandText = "S ELECT * From {XM_在建项目} Where 项目名称 = \'" & nm & "\'"
        If cmd.ExecuteScalar > 0 Then
            Messagebox.Show("在建项目已经存在【" & r("项目名称")  & "】","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Exit Function
        End If
        cmd.CommandText = "S ELECT * From {XM_在建项目} Where 项目名称 = \'" & nm & "\'"
        dt = cmd.Execu teReader(True)
        msgbox(dt.datarows.count)

--  作者:有点色
--  发布时间:2019/4/21 17:54:00
--  

改成比如

 

        cmd.CommandText = "S ELECT * From {XM_在建项目} Where 项目名称 = \'" & nm & "\'"
        dt = cmd.Execu teReader(True)
        msgbox(dt.datarows.count)
        If dt.datarows.count > 0 Then
            Messagebox.Show("在建项目已经存在【" & r("项目名称")  & "】","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Exit Function
        End If

--  作者:有点色
--  发布时间:2019/4/21 17:55:00
--  
以下是引用zoyong在2019/4/21 11:01:00的发言:
开标时间控件输入2019-04-21 09:30  离开控件就变成2019-04-21 00:00   

 

实例发上来测试。

 


--  作者:zoyong
--  发布时间:2019/4/23 16:16:00
--  
Dim b1 As New GroupTableBuilder("统计表_开标本年",dt)
Dim nf As String = Date.Today.year-2 
b1.Filter = "[年份] = \'" & nf & "\'" 
b1.Groups.AddDef("开标时间",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称
b1.Groups.AddDef("开标时间","月") \'添加日期列用于分组,并用"月"代替原名称 
b1.Totals.AddDef("数量") \'添加数量列用于统计
b1.Subtotal = True \'生成汇总模式
b1.SubtotalLevel = 0 \'只生成总计行
b1.Build \'生成统计表


已解决
[此贴子已经被作者于2019/4/23 16:29:17编辑过]

--  作者:zoyong
--  发布时间:2019/4/28 11:19:00
--  

.NET Framework 版本:2.0.50727.8800
Foxtable 版本:2019.4.12.1
错误所在事件:窗口,内部合同,打印预览,Click
详细错误信息:
检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80040154。

 

就一台电脑不能打印WORD

[此贴子已经被作者于2019/4/28 11:20:19编辑过]

--  作者:有点甜
--  发布时间:2019/4/28 11:22:00
--  

参考

 

1、

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=54396&replyID=360697&skin=1

 

2、如果1无法修复,就重新安装一下wps。


--  作者:zoyong
--  发布时间:2019/5/10 20:59:00
--  

If e.DataCol.Name = "开票金额" Then
    If e.NewValue IsNot Nothing Then        
        \'求总金额
        Dim Filter As String = "[项目名称] = \'" & e.NewValue & "\'"
        Dim je As String = DataTables("项目开票_table1").Compute("Sum(开票金额)", Filter)   ‘代码不起作用’
        If  e.DataRow("中标价") < je Then
            MessageBox.Show("本项目已开票总金额【" & je & "】,大于中标价【" & e.DataRow("中标价")  & "】,请核对!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        End If
    End If
End If


大神帮忙看看红色代码     合计已开票的总金额  是不是  大于中标价

--  作者:有点蓝
--  发布时间:2019/5/10 21:07:00
--  
 Dim je As String
改为
 Dim je As Double