以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  打印模板  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=84737)

--  作者:woshiabc
--  发布时间:2016/5/9 15:59:00
--  打印模板


图片点击可在新窗口打开查看此主题相关图片如下:@wvcog(nu7ms1g`atyvro{4.png
图片点击可在新窗口打开查看

请问下,需要打印当前报价单编号相同的报价明细,代码如下,出现上面错误,如何解决?是我代码有问题?
Dim Book As New XLS.Book(ProjectPath & "Attachments\\QuotationA客户.xls") \'打开模板
Dim fl As String = ProjectPath & "Reports\\QuotationA客户.pdf"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim Filter As String
With Tables("A客户Grip_Table2")
    If .current("报价单编号") Is Nothing Then
        filter = "False"
    Else
        Filter = "报价单编号 = \'" & .Current("报价单编号") & "\'"
    End If
End With

If filter > "" Then
    Sheet(3,19).Value = "<" & filter & ">"
Else
    Sheet(3,19).Value = "<all>"
End If
Book.Build() \'生成报表
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
 


--  作者:大红袍
--  发布时间:2016/5/9 16:00:00
--  

Dim fl As String = ProjectPath & "Reports\\QuotationA客户.pdf"

 

改成

 

Dim fl As String = ProjectPath & "Reports\\QuotationA客户.xls"


--  作者:大红袍
--  发布时间:2016/5/9 16:01:00
--  

如果要转pdf,参考

 

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

 


--  作者:woshiabc
--  发布时间:2016/5/9 16:23:00
--  
还是不行,结果不是想要的内容
--  作者:大红袍
--  发布时间:2016/5/9 16:25:00
--  

Dim Book As New XLS.Book(ProjectPath & "Attachments\\QuotationA客户.xls") \'打开模板
Dim fl As String = ProjectPath & "Reports\\QuotationA客户.pdf"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim Filter As String
With Tables("A客户Grip_Table2")
    If .current("报价单编号") Is Nothing Then
        filter = "False"
    Else
        Filter = "报价单编号 = \'" & .Current("报价单编号") & "\'"
    End If
End With

If filter > "" Then
    Sheet(3,19).Value = "<" & filter & ">"
Else
    Sheet(3,19).Value = "<all>"
End If
Book.Build() \'生成报表
Book.SaveToPDF(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()