Dim b As New SQLGroupTableBuilder("各工序加工张数统计","生产加工登记表")
b.C
b.Groups.AddDef("加工时间", DateGroupEnum.Year, "年")
b.Groups.AddDef("加工时间", "月")
b.Groups.Adddef("工资成本归属部门")
b.Groups.Adddef("工序名称")
b.Groups.Adddef("产品名称及令号")
b.Totals.Addexp("加工量次数","加工数量*加工道数")
b.Totals.Addexp("计件工资总额","加工数量*本单计件单价*加工道数")
b.Totals.Addexp("染色出鼓张数","iif(工序名称 = \'染色出鼓\',加工数量,0)")
b.Build()
DataTables("各工序加工张数统计").DataCols.Add("所属生产线",Gettype(String),"IIF([产品名称及令号] is null,\'\',IIF([产品名称及令号] Like \'%xmg%\' or [产品名称及令号] Like \'%lsx%\'or [产品名称及令号] Like \'%鞋面革%\',\'鞋面革\',))")
DataTables("各工序加工张数统计").DataCols.Add("层别",Gettype(String),"IIF([产品名称及令号] is null,\'\',IIF([产品名称及令号] Like \'%打样%\'or [产品名称及令号] Like \'%样品%\',\'打样\'))")
DataTables("各工序加工张数统计").DataCols.Add("加工张数",Gettype(Double),"")
MainTable = Tables("各工序加工张数统计")