Foxtable(狐表)用户栏目专家坐堂 → 通过ADOBE虚拟打印机将文件导出为PDF格式文件,能否再以当前标题命名文件


  共有12550人关注过本帖树形打印复制链接

主题:通过ADOBE虚拟打印机将文件导出为PDF格式文件,能否再以当前标题命名文件

帅哥哟,离线,有人找我吗?
blackzhu
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:狐仙 帖子:9879 积分:57640 威望:0 精华:15 注册:2008/9/1 9:45:00
  发帖心情 Post By:2011/8/3 7:59:00 [显示全部帖子]

Tables("订单明细").Sort = "订单号"

'选择全表

CurrentTable.Select(0, 0, CurrentTable.Rows.Count - 1, CurrentTable.Cols.Count - 1)

Dim T,T1,T2,T3,T4 As String

If FileSys.FileExists(ProjectPath & "Attachments\规格\" & Tables("订单情况").Current("IO") & "\ " & Tables("订单情况").Current("IO") & T3 &  T2 & T4 & T & ".xls") Then

    FileSys.DeleteFile(ProjectPath & "Attachments\规格\" & Tables("订单情况").Current("IO") & "\ " & Tables("订单情况").Current("IO") & T3 & T2 & T4 & T & ".xls")

End If

T =  e.Form.Controls("ComboBox1").value

T1 = ProjectPath & "Attachments\" & T & ".xls"

T2 = e.Form.Controls("ComboBox8").value

T3 = e.Form.Controls("ComboBox5").value

T4 =  e.Form.Controls("ComboBox10").value

If T IsNot Nothing Then

    If T.Indexof(T) > -1 Then

        Dim Book As New XLS.Book(T1)

        Dim v As Double = DataTables("装箱单").Compute("Sum(箱数)","口岸 = '" &  T3 & " '")

        Book.Marks.Add("箱数",v)

        Dim v3 As Double = DataTables("装箱单").Compute("Sum(箱数)","口岸 = '" &  T2 & " '")

        Book.Marks.Add("箱数1",v3)

        Dim v1 As Double = DataTables("装箱单").Compute("Sum(总件数)","口岸 = '" &  T3 & " '")

        Book.Marks.Add("件数",v1)

        Dim v2 As Double = DataTables("订单明细").Compute("Sum(TOTAL)")

        Book.Marks.Add("总件数",V2 & "PCS")

        Book.Build()

        Book.Save(ProjectPath & "Attachments\规格\" & Tables("订单情况").Current("IO") & "\" & Tables("订单情况").Current("IO") & T3 & T2 & T4 & T & ".xls")

        Dim App As New MSExcel.Application

        Dim Wb As MSExcel.Workbook = App.WorkBooks.Open(ProjectPath &  "Attachments\规格\" & Tables("订单情况").Current("IO") & "\" & Tables("订单情况").Current("IO") & T3 & T2 & T4 & T &".xls")

        Dim Wd As MSExcel.Window = Wb.Windows(1)    '表示当前工作簿窗口

        Wd.DisplayZeros = False                 '不显示0值

        App.Visible = True

        Wb.Save

    End If

End If


这个代码是我的,打印的格式是XLS,是根据IO号打印到此文件夹中,自己修改一下.


 回到顶部