Dim Filter As
String
With e.Form.Controls("StartDate")
If .Value IsNot Nothing
Then
If Filter >"" Then
Filter = Filter & " And "
End
If
Filter = Filter & "日期 >= #" & .Value & "#"
End
If
End
With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing
Then
If Filter >"" Then
Filter = Filter & " And "
End
If
Filter = Filter & "日期 <= #" & .Value & "#"
End
If
End
With
Dim g As New CrossTableBuilder("统计表1", DataTables("2012年数据"))
g.Filter=Filter
g.Caption = "下属企业经营情况"
g.HGroups.AddDef("下属企业")
g.VGroups.AddDef("经营范围")
g.Totals.AddDef("项目编号", AggregateEnum.Count, "项目编号")
g.HorizontalTotal = True
g.VerticalTotal = True
g.Build()
MainTable = Tables("统计表1")