Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
请教老师,想得到下边的表,是否能实现
我写了如下代码,有错误
Dim sql As String = "Sele ct 接单日期,{接单登记}.接单单号,期望发货日期,客户来源,客户名称,收货地址,产品名称,规格型号,单位,单价,销售数量,发货数量 as 已发货数量,(销售数量 - 发货数量) AS 未发货数量 From ({接单登记} Inner JOIN {接单明细} ON {接单明细}.[接单单号] = {接单登记}.[接单单号]) ORDER BY 接单日期"
Dim sqlf As String = "Sele ct 发货日期,{发货表}.发货单号,{发货表}.接单单号,客户名称,收货地址,产品名称,规格型号,单位,发货数量 From ({发货表} Inner JOIN {发货明细} ON {发货明细}.[发货单号] = {发货表}.[发货单号]) ORDER BY 发货日期"
Dim bd1 As New CrossTableBuilder("统计表1", sql)
Dim dt1 As fxDataSource
bd1.HGroups.AddDef("接单日期", DateGroupEnum.none)
bd1.HGroups.AddDef("接单单号")
bd1.HGroups.AddDef("客户名称")
bd1.HGroups.AddDef("产品名称") '添加客户列用于水平分组
bd1.HGroups.AddDef("规格型号") '添加客户列用于水平分组
bd1.HGroups.AddDef("单位") '添加客户列用于水平分组
bd1.HGroups.AddDef("销售数量")
bd1.HGroups.AddDef("已发货数量")
bd1.HGroups.AddDef("未发货数量")
dt1 = bd1.BuildDataSource()
Dim bd2 As New CrossTableBuilder("统计表2", sqlf)
Dim dt2 As fxDataSource
bd2.VGroups.AddDef("发货日期", DateGroupEnum.none)
bd2.vGroups.AddDef("发货数量")
dt2 = bd1.BuildDataSource()
Dim nms As String() = {"接单单号", "客户名称", "产品名称" }
dt1.Combine(nms, dt2, nms)
Tables("窗口2_Table1").DataSource = dt1
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:测试.zip |