以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- HttpRequest中,SQLGroupTableBuilde的几个问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=100438) |
-- 作者:szfiat -- 发布时间:2017/5/11 13:03:00 -- HttpRequest中,SQLGroupTableBuilde的几个问题 关于SQLGroupTableBuilde有两个问题: 一、Subtotal的属性,在HttpRequest中没有作用 例如代码 gp.C gp.Subtotal = True 网页中的表格并没有出现汇总模式行 二、组合统计后,如何在网页上显示出来 帮助中的代码是dt1.Combine("型号",dt2,"型号") 在网页中看到是用CreateFromDataTable来显示单个统计表的 With wb.AddTable("","Table1") .CreateFromDataTable(gp.Build(True)) End With 如组合多张表后,在httprequest中要如何写呢,谢谢
|
-- 作者:有点色 -- 发布时间:2017/5/11 14:32:00 -- 1、如果要生成汇总模式,要这样写
http://www.foxtable.com/mobilehelp/scr/0135.htm
2、先生成具体的表show出来,比如 dt1.Show("统计表1"),然后直接使用 统计表1 |
-- 作者:有点蓝 -- 发布时间:2017/5/11 14:44:00 -- 如果不想生成具体的表,只能手工生成:http://www.foxtable.com/mobilehelp/scr/0072.htm HttpRequest事件 Dim fl As String = "d:\\web\\" & e.path If filesys.FileExists(fl) Dim idx As Integer = fl.LastIndexOf(".") Dim ext As String = fl.SubString(idx) Select Case ext Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar" e.WriteFile(fl) Return \'这里必须返回 End Select End If Select Case e.Path Case "table.htm" Dim wb As New WeUI Dim bd1 As New GroupTableBuilder("统计表1",DataTables("进货单")) Dim dt1 As fxDataSource bd1.Groups.AddDef("型号") \'根据型号分组 bd1.Totals.AddDef("数量","进货_数量") \'对数量进行统计 bd1.Totals.AddDef("金额","进货_金额") \'对金额进行统计 dt1 = bd1.BuildDataSource() Dim bd2 As New GroupTableBuilder("统计表2",DataTables("销售单")) Dim dt2 As fxDataSource bd2.Groups.AddDef("型号") \'根据型号分组 bd2.Totals.AddDef("数量","销售_数量") \'对数量进行统计 bd2.Totals.AddDef("金额","销售_金额") \'对金额进行统计 dt2 = bd2.BuildDataSource() Dim bd3 As New GroupTableBuilder("统计表3",DataTables("退货单")) Dim dt3 As fxDataSource bd3.Groups.AddDef("型号") \'根据型号分组 bd3.Totals.AddDef("数量","退货_数量") \'对数量进行统计 bd3.Totals.AddDef("金额","退货_金额") \'对金额进行统计 dt3 = bd3.BuildDataSource() dt1.Combine("型号",dt2,"型号") \'将销售统计数据组合到进货统计数据 dt1.Combine("型号",dt3,"型号") \'将退货统计数据组合到进货统计数据 With wb.AddTable("","Table1") .Alternate = 3 Dim nms() As String = {"型号","进货_数量","进货_金额","销售_数量","销售_金额","退货_数量","退货_金额"} .Head.AddRow(nms) For Each r As System.Data.DataRow In dt1.Rows With .Body.AddRow() For Each nm As String In nms If r(nm) Is System.DBNull.Value Then .AddCell("") Else .AddCell(r(nm)) End If Next End With Next End With e.WriteString(wb.Build) End Select |
-- 作者:szfiat -- 发布时间:2017/5/11 16:36:00 -- 非常感谢:) |