Dim values As String=Nothing
Dim i1 As Integer
If Tables("pack99").Rows.Count>0 Then '如果有记录
For Each dr As Row In Tables("pack99").Rows
values=values & dr("order_id") & ","
Next
values=values.Substring(0,values.length - 1) 上面收集当前查询表中所有记录的数字型KEY键
messagebox.show(values) ‘结果显示有: 10,11,12,13,14
Dim Book As New XLS.Book(ProjectPath & "Attachments\pack99_report.xls") '9_report.xls")
Dim sheet As XLS.Sheet = Book.Sheets(0)
Dim Style As Xls.Style=book.NewStyle
Style.BackColor=Color.Red
ExcelPath="D:\step00\"
Dim fl As String = ExcelPath & "ExcelReport\pack99_report.xls" '9_report.xls"
book.AddDataTable("pack991","erp_opti","Se lect * fr om {pack99} where order_id in (values) ") '在这里使用报错,order_id 是数字型 Key,
book.Build()
book.save( fl ) 'fl
Dim proc As New Process
Proc.file=fl
proc.Start()
End If
请教这句: book.AddDataTable("pack991","erp_opti","Se lect * fr om {pack99} where order_id in (values) ") ' 正确句法,order_id 是数字型 Key,
谢谢!谢谢!
[此贴子已经被作者于2019/5/4 16:35:47编辑过]