这个FORMAT我也有试过啊!比如这个代码!
Dim sd As Date = e.Form.Controls("sd").value
Dim ed As Date = e.Form.Controls("ed").value
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xls" '设置筛选器
Dim ex As New Exporter
If sd = #01/01/0001# OrElse ed = #01/01/0001# Then
MessageBox.Show("请输入起始日期和结束日期","注意",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If dlg.ShowDialog = DialogResult.OK Then
ex.SourceTableName = "a" '指定导出表
ex.Format = "dlg" '指定目标文件
ex.Fields = "ID,卡号,姓名,时间,dn,MachNo" '指定导出字段
ex.Filter = "[dn] like '" & _Userdept & "' And [时间] >= #" & sd & "# And [时间] <= #" & ed & "#"
'指定导出条件
ex.Export() '开始导出
End If
这个dlg我就不知道怎么去定义它了!乱搞!
[此贴子已经被作者于2013-5-10 21:26:33编辑过]