以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助][讨论]网页上日期引用 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=146639) |
||||
-- 作者:nths -- 发布时间:2020/2/28 11:51:00 -- [求助][讨论]网页上日期引用 老师:你好!写了以下代码 ,想实现输入开始日期和结束日期 点确定能生成各账户的余额,但统计表1中没有数据 是不是引用“开始日期”和“结束日期”代码错误?正确代码应该怎样写?谢谢 Dim wb As New WeUI
Select Case e.Path Case "filter.htm" wb.AddForm("","form1","list.htm") With wb.AddInputGroup("form1","ipg1","现金银行余额") .AddInput("startdate","开始日期","date") .AddInput("enddate","结束时间","date") End With
|
||||
-- 作者:nths -- 发布时间:2020/2/28 11:54:00 -- 代码 b.Filter =
"日期 < \'"& e.PostValues("startdate") & "\'" |
||||
-- 作者:nths -- 发布时间:2020/2/28 11:55:00 -- 代码 b.Filter = "日期 < \'"& e.PostValues("startdate") & "\'" 引用不了 |
||||
-- 作者:有点蓝 -- 发布时间:2020/2/28 12:14:00 -- 贴出完整代码 |
||||
-- 作者:nths -- 发布时间:2020/2/29 21:12:00 -- Dim wb As New WeUI Select Case e.Path Case "filter.htm" wb.AddForm("","form1","list.htm") With wb.AddInputGroup("form1","ipg1","现金银行余额") .AddInput("startdate","开始日期","date") .AddInput("enddate","结束时间","date") End With |
||||
-- 作者:nths -- 发布时间:2020/2/29 21:21:00 -- 完整代码 |
||||
-- 作者:nths -- 发布时间:2020/2/29 21:21:00 -- 完整代码
|
||||
-- 作者:有点蓝 -- 发布时间:2020/3/1 20:36:00 -- Dim wb As New WeUI Select Case e.Path Case "filter.htm" wb.AddForm("","form1","list.htm") With wb.AddInputGroup("form1","ipg1","现金银行余额") .AddInput("startdate","开始日期","date") .AddInput("enddate","结束时间","date") End With \' With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With Case "list.htm" Dim sql As String = "Select * FROM {日记账} " Dim b As New SQLGroupTableBuilder("统计表1",sql, "Data1") Dim ft1 As fxDataSource Dim Filter As String b.Filter = "日期 < \'"& e.PostValues("startdate") & "\'" b.Groups.AddDef("账户") b.Groups.AddDef("账户科目代码") b.Totals.AddDef("借方金额","借方金额1") b.Totals.AddDef("贷方金额","贷方金额1") ft1 = b.BuildDataSource() Dim sql2 As String = "Select * FROM {日记账} " Dim b1 As New SQLGroupTableBuilder("统计表2",sql2, "Data1") Dim ft2 As fxDataSource If e.PostValues.ContainsKey ("startdate") Filter = "日期 >= \'" & e.PostValues("startdate") & "\'" End If If filter > "" Then filter = filter & " and " If e.PostValues.ContainsKey ("enddate") Filter = Filter & "日期 <= \'" & e.PostValues("enddate") & "\'" End If b1.Filter = Filter b1.Groups.AddDef("账户") b1.Groups.AddDef("账户科目代码") b1.Totals.AddDef("借方金额" ,"本期借方金额") b1.Totals.AddDef("贷方金额","本期贷方金额") ft2 = b1.BuildDataSource() Dim nms As String() = {"账户"} \'指定连接列 ft1.Combine(nms,ft2,nms) \'将销售统计数据组合到进货统计数据 ft1.show("统计表1") With DataTables("("统计表1")") .DataCols \'用表达式列计算库存数据 .Add("期初余额",Gettype(Double), "IsNull([借方金额1],0) - ISNULL([贷方金额1],0)") .Add("期末余额",Gettype(Double), "IsNull([借方金额1],0) + ISNULL([本期借方金额],0) - ISNULL([贷方金额1],0) - ISNULL([本期贷方金额],0)") End With\' Tables("统计表1").SetColVisibleWidth("账户|130|期初余额|90|本期借方金额|90|本期贷方金额|90|期末余额|90|") With wb.AddTable("","Table1") \'.CreateFromTable(Tables("统计表1"),True) .CreateFromDataTable(Tables("统计表1"),True,"账户","期初余额","本期借方金额","本期贷方金额","期末余额") End With End Select e.WriteString(wb.Build) 虽然勉强可以这样用,但是不建议在服务端使用fxDataSource,因为并发会有问题。建议使用sql处理
|
||||
-- 作者:nths -- 发布时间:2020/3/6 9:40:00 -- 老师:你好!我按照帮助文件中使用关联表做了简单的材料入库录入 代码如附件,不知哪里错了,入库明显示不了,麻烦老师给予指导,谢谢 |
||||
-- 作者:nths -- 发布时间:2020/3/6 9:41:00 -- 老师:你好!我按照帮助文件中使用关联表做了简单的材料入库录入 代码如附件,不知哪里错了,入库明显示不了,麻烦老师给予指导,谢谢
|