此主题相关图片如下:1.png
如图,在一键打印:
If Tables("T_Report").current IsNot Nothing Then
DataTables("T_Item").ReplaceFor("开单状态",True,"[报告编号] = '" & Tables("T_Report").current("报告编号") & "'")
DataTables("T_Item").ReplaceFor("内测标识",True,"[报告编号] = '" & Tables("T_Report").current("报告编号") & "'")
End If
DataTables("T_Item").save()
Dim bhs As List(Of String) = DataTables("T_Item").GetValues("表单编号", "报告编号 = '" & Tables("T_Report").current("报告编号") & "'")
For Each bh As String In bhs
If bh IsNot Nothing Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\" & bh & ".xls")
Dim fl As String = ProjectPath & "Reports\" & Tables("T_Report").current("报告编号")& "&" & bh & ".xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
End If
Next
选中打印:
Dim dic As new Dictionary(Of String, String)
For Each r As Row In Tables("T_Report.T_Item").GetCheckedRows
r("开单状态") = True
r("内测标识") = True
r.save
If dic.ContainsKey(r("表单编号")) = False Then
dic.add(r("表单编号"), r("_Identify"))
Else
dic(r("表单编号")) = dic(r("表单编号")) & "," & r("_Identify")
End If
Next
For Each key As String In dic.Keys
Dim Book As New XLS.Book(ProjectPath & "Attachments\" & key & ".xls")
Dim fl As String = ProjectPath & "Reports\" & Tables("T_Report").current("报告编号")& "&" & key & ".xls"
vars("编号") = key
book.Sheets(0)(8, 7).Value = "<_Identify in (" & dic(key) & ")>"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
Next
如报表为CTT-WI-F9999-01A,设置如下:
此主题相关图片如下:2.png
以上在打印到这个表单的时候无论是一键还是选中都是提示文件存储失败,请问是什么问题?
此主题相关图片如下:3.png
[此贴子已经被作者于2016/12/20 18:55:46编辑过]