这种方式导出:
Dim pd As String =SpecialFolder.DesktopDirectory & "\pd\" & Date.now.Hour & Date.now.Minute & Date.now.Second & ".txt"
Dim ex As New Exporter
ex.SourceTableName = "盘点" '指定导出表
ex.FilePath = SpecialFolder.DesktopDirectory & "\pd\" '指定目标文件路径
ex.Format = "Delimited" '导出格式为符号分割的文本文件
ex.NewTableName = Date.now.Hour & Date.now.Minute & Date.now.Second '指定文件名,注意无须扩展名
ex.Fields="条码,库位,数量"
ex.Export() '开始导出
或者加上列标题
Dim str As String = """库位"",""条码"",""数量"""
Dim t As Table = Tables("盘点")
For Each r As Row In t.Rows
If r("条码") <> "本库位合计" Then
str = str & vbcrlf
For Each c As Col In t.cols
If c.name = "库位" Or c.name = "条码" Or c.name = "数量" Then
str &= r(c) & ","
End If
Next
str = str.Trim(",")
End If
Next