此主题相关图片如下:2017-12-01_033934.jpg
下面的代码实现了上图效果
If e.DataCol.Name = "年份" Then
Dim cns() As String = {"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"}
If e.DataRow.IsNull(e.DataCol.name) Then
For Each cn As String In cns
e.DataRow(cn) = Nothing
Next
Else
Dim filter = "(订单门店 = '" & e.DataRow("门店名称") & "')"
For i As Integer = 0 To cns.Length - 1
Dim d As Date = new Date(cint(e.newValue), i+1, 1)
e.DataRow(cns(i)) = DataTables("订单主表").compute("sum(订单总额)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
Next
End If
End If
此主题相关图片如下:1.jpg
怎么实现这个图中的月份下面的四个小栏目有相应的数据呢?
DataTables("订单主表").compute("sum(订单总额)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
DataTables("订单主表").compute("sum(定金)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
DataTables("订单主表").compute("sum(首付款)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
DataTables("订单主表").compute("sum(尾款)", filter & " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.AddMonths(1) & "#")
[此贴子已经被作者于2017/12/1 3:47:56编辑过]