以下是表1的统计代码,我想要表2的统计样式
Dim cmb As New SQLCommand
cmb.C
cmb.CommandText = "Select * Fro m {销售} Where 月 >= '" & e.Form.Controls("起始月").Text & "' And 月 <= '" & e.Form.Controls("截止月").Text & "'"
Dim f As New CrossTableBuilder("销售统计", cmb.ExecuteReader())
f.HGroups.AddDef("产品类别")
f.VGroups.AddDef("月", "{0}")
f.Totals.AddDef("数量", "数量")
f.Totals.AddDef("金额", "金额")
f.OrderByTotal = True
f.HorizontalTotal = True '水平合计
f.VerticalTotal = True '垂直合计
f.Decimals = 0
f.Build()
Tables("销售统计_销售统计表").DataSource = DataTables("销售统计")
Tables("销售统计_销售统计表").AutoSizeCols() '设置自动列宽
此主题相关图片如下:snap1.jpg