以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何导出订单主要一个订单的明细,导出的是全部明细,没有根据订单号导出明细???请问要怎么解决呢?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=57014)

--  作者:nieky
--  发布时间:2014/9/16 20:54:00
--  如何导出订单主要一个订单的明细,导出的是全部明细,没有根据订单号导出明细???请问要怎么解决呢?
Dim str As String = "采购订单.xls"
If FileSys.FileExists(ProjectPath & "Attachments\\" & str) Then
If Tables("订单主表.订单明细表").rows.count>0 Then
    If e.Form.Controls("CheckBox2").Checked Then
        Tables("订单主表.订单明细表").Select(0,0,Tables("订单主表.订单明细表").rows.count-1,0)
    End If
    Dim Book As New XLS.Book(ProjectPath & "Attachments\\" & str) 
    Dim i As Integer
    Dim str1 As String = "订单交期,联系人,联系方式,传真,订单号"
    Dim str2 As String = "DateTimePicker1,TextBox3,TextBox1,TextBox2,TextBox4"
    For Each k As String In str2.split(",")
        Book.Marks.Add(str1.split(",")(i),e.form.Controls(k).Value)
        i += 1
    Next 
    Book.Build()
    Book.Save(ProjectPath & "Reports\\" & str) 
    Dim Proc As New Process
    Proc.File = ProjectPath & "Reports\\" & str
    Proc.Start()
Else
    msgbox("当前表无有记录!",64,"提示")
End If
Else
    msgbox("找不到""" & str & """模板!",64,"提示")
End If

--  作者:有点甜
--  发布时间:2014/9/16 21:34:00
--  

 你可以动态的修改导出的条件的,参考

 

 http://www.foxtable.com/help/topics/2626.htm