窗口的统计表(窗口表)导出不了。
统计代码:
Dim b As New SQLGroupTableBuilder("统计表1","VIP会员基本信息")
b.C
b.Groups.AddDef("发卡单位") '根据产品分组
b.Groups.AddDef("建档日期","月份")
b.Totals.AddDef("建档日期",AggregateEnum.count,"本月开卡数") '对数量进行统计
b.Filter = filter
Tables(e.Form.Name & "_table1").DataSource = b.BuildDataSource()
导出代码 :
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "excel文件|*.xlsx" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ex As New Exporter
ex.Format = "Excel" '导出格式为Excel
ex.SourceTableName = e.Form.Name & "_table1" '指定导出表
ex.filepath = dlg.FileName '指定目标文件
ex.Export() '开始导出
End If
出错:
---------------------------
Object reference not set to an instance of an object.