Dim bd1 As New
SQLGroupTableBuilder("统计表1","进货单")
Dim
dt1 As fxDataSource
bd1.Groups.AddDef("型号") '根据型号分组
bd1.Totals.AddDef("数量","进货_数量") '对数量进行统计
bd1.Totals.AddExp("进货_金额","数量 * 单价") '对金额进行统计
dt1 =
bd1.BuildDataSource()
Dim
bd2 As New
SQLGroupTableBuilder("统计表2","销售单")
Dim
dt2 As fxDataSource
bd2.Groups.AddDef("型号") '根据型号分组
bd2.Totals.AddDef("数量","销售_数量") '对数量进行统计
bd2.Totals.AddExp("销售_金额","数量 *
售价") '对金额进行统计
dt2 = bd2.BuildDataSource()
Dim
bd3 As New
SQLGroupTableBuilder("统计表3","退货单")
Dim
dt3 As fxDataSource
bd3.Groups.AddDef("型号") '根据型号分组
bd3.Totals.AddDef("数量","退货_数量") '对数量进行统计
bd3.Totals.AddExp("退货_金额","数量 * 单价") '对金额进行统计
dt3 =
bd3.BuildDataSource()
dt1.Combine("型号",dt2,"型号") '将销售统计数据组合到进货统计数据
dt1.Combine("型号",dt3,"型号") '将退货统计数据组合到进货统计数据
dt1.Show("统计表1") '显示统计结果
此主题相关图片如下:qq截图20220421145757.png
是否可以在前面增加列,用表达式进行求值
对于小型企业,想对全部数据进行核算求出期初余额,怎样才能在这表插入二列并用达表式进行求值,并把前的列隐藏???