If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ex As New Exporter
ex.SourceTableName = t1.DataTable.Name '指定导出表
ex.filepath = dlg.FileName
ex.NewTableName = "明细"
if dlg.FileName like "*.xlsx" then
ex.Format = "Excel2007"
else
ex.Format = "Excel"
end if
ex.Export() '开始导出
ex = New Exporter
ex.SourceTableName = t2.DataTable.Name '指定导出表
ex.filepath = dlg.FileName
ex.NewTableName = "汇总"
if dlg.FileName like "*.xlsx" then
ex.Format = "Excel2007"
else
ex.Format = "Excel"
end if
ex.Export() '开始导出
[此贴子已经被作者于2022/11/22 10:59:52编辑过]