以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]副本NORMAL窗表无法导出EXCEL  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=42599)

--  作者:hiliuyong
--  发布时间:2013/11/16 17:04:00
--  [求助]副本NORMAL窗表无法导出EXCEL

\'msgbox(Tables("做货_Table1").DataTable.Name)

\'=上货明细


Dim dlg As New SaveFileDialog
dlg.Filter= "Excel文件|*.xls"
If dlg.ShowDialog = DialogResult.Ok Then
    Dim ex As New Exporter
    ex.SourceTableName = "做货_Table1"
    ex.filepath = dlg.FileName
    ex.Format = "Excel"
    ex.Export()
    MessageBox.Show("導出完畢!", "提示")
End If

 

提示不存在“做货_Table1” 的Datatable.

但是

msgbox(Tables("做货_Table1").DataTable.Name)

=上货明细

如果改为

ex.SourceTableName = "上货明细"

则为导出所有列,但是只需要导出"做货_Table1"所显示的列


(上一贴乱码,重发一遍)


--  作者:Bin
--  发布时间:2013/11/16 17:09:00
--  
Filter
Dim dlg As New SaveFileDialog
dlg.Filter= "Excel文件|*.xls"
If dlg.ShowDialog = DialogResult.Ok Then
    Dim ex As New Exporter
    ex.SourceTableName = "上货明细"
    ex.filepath = dlg.FileName
    ex.Format = "Excel"
   ex.Filter=Tables("做货_Table1").Filter
    ex.Export()
    MessageBox.Show("導出完畢!", "提示")
End If