以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  报表生成的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=87131)

--  作者:hongyefor
--  发布时间:2016/7/4 14:24:00
--  报表生成的问题

Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim tmp As String = ProjectPath & "Attachments\\订单清单.xls"
Dim rpt As String = "d:/订单/"+ e.DataRow("所属年份")+ e.DataRow("所属月份")+"订单清单.pdf"
Dim Book As New XLS.Book(tmp)
Book.Build()
Book.SaveToPDF(rpt) \'保存为pdf文件
wbr.AddRess = rpt

 

 


图片点击可在新窗口打开查看此主题相关图片如下:qq拼音截图未命名.jpg
图片点击可在新窗口打开查看

 

表名为“A表”在窗口的“生成报表”按钮里写的
我想把文件按照e.DataRow("所属年份")+ e.DataRow("所属月份")重命名并保存到D盘的订单文件夹里,请问怎么搞


--  作者:大红袍
--  发布时间:2016/7/4 14:52:00
--  

Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")

Dim r As Row = Tables("表a").Current
Dim tmp As String = ProjectPath & "Attachments\\订单清单.xls"
Dim rpt As String = "d:/订单/" & r("所属年份") & r("所属月份")+"订单清单.pdf"
Dim Book As New XLS.Book(tmp)
Book.Build()
Book.SaveToPDF(rpt) \'保存为pdf文件
wbr.AddRess = rpt


--  作者:hongyefor
--  发布时间:2016/7/4 15:37:00
--  

Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim tmp As String = ProjectPath & "Attachments\\订单清单.xls"
Dim tmp1 As String = ProjectPath & "Attachments\\订单接口报表.xls"
Dim rpt1 As String = "d:/订单/"+(Tables("订单报表").Current("所属年份")) + (Tables("订单报表").Current("所属月份"))   +"01.xls"
Dim rpt As String = "d:/订单/"+(Tables("订单报表").Current("所属年份")) + (Tables("订单报表").Current("所属月份"))   +"订单清单.pdf"
Dim Book As New XLS.Book(tmp)
Dim Book1 As New XLS.Book(tmp1)
Book.Build()
Book1.Build()
Book1.Save(rpt1)‘保存为pdf文件
Book.SaveToPDF(rpt) \'保存为pdf文件
wbr.AddRess = rpt

能不能加一个IF啊,我想在保存以上2个文件是,检查这个文件是否已经存在,如果已存在就只显示,不保存


--  作者:大红袍
--  发布时间:2016/7/4 15:45:00
--  

Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim tmp As String = ProjectPath & "Attachments\\订单清单.xls"
Dim tmp1 As String = ProjectPath & "Attachments\\订单接口报表.xls"
Dim rpt1 As String = "d:/订单/"+(Tables("订单报表").Current("所属年份")) + (Tables("订单报表").Current("所属月份"))   +"01.xls"
Dim rpt As String = "d:/订单/"+(Tables("订单报表").Current("所属年份")) + (Tables("订单报表").Current("所属月份"))   +"订单清单.pdf"
If FileSys.FileExists(rpt) = False Then
    Dim Book As New XLS.Book(tmp)
    Dim Book1 As New XLS.Book(tmp1)
    Book.Build()
    Book1.Build()
    Book1.Save(rpt1)\'保存为pdf文件
    Book.SaveToPDF(rpt) \'保存为pdf文件
End If

wbr.AddRess = rpt

[此贴子已经被作者于2016/7/4 15:45:17编辑过]