.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2017.4.22.1
错误所在事件:窗口,备品单制作,But导出PDF,Click
详细错误信息:
值不在预期的范围内。
代码如下:Office 版本是2013
e.Form.Controls("Chk备品").Checked = True
Dim tb As Table = Tables(e.Form.Name & "_Table1")
Dim dt As DataTable = tb.DataTable
Dim r As Row = tb.Current
Dim Book As New XLS.Book(ProjectPath & "Attachments\配件表.xls") '打开模板
Dim fl As String = "d:\配件表\" & r("排产单号") & "_配件表.xls"
Dim pdf As String = "d:\配件表\" & r("排产单号") & "_配件表.pdf"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(1,7).Value = "日期:" & Date.Today
Sheet(0,1).Value = r("排产单号") & " 配件表"
Sheet(3,0).Value = "<" & e.Form.Name & "_Table1>"
Sheet(4,2).Value = "'<" & e.Form.Name & "_Table1>"
Book.Build() '生成报表
Book.Save(fl)
Book.SaveToPDF(pdf) '保存为PDF文件
Dim Proc As New Process '打开PDF文件
Proc.File = fl
Proc.Start()
[此贴子已经被作者于2017/5/31 16:52:26编辑过]