Dim fl As String = ProjectPath & "Reports\寄样衣记录.xls"
Dim App As New MSExcel.Application
for i as integer = 0 to tables("寄样衣记录").rows.count - 1tables("寄样衣记录").position = iDim Book As New XLS.Book(ProjectPath & "Attachments\寄样衣记录.xls")
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
try
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Ws.PrintOut(Copies:=tables("寄样衣记录").rows(i)("QTY"))
Wb.clsoe
Catch ex As Exception
MessageBox.Show(ex.message)
Wb.clsoe
End try
Application.DoEvents
next
App.Quit
[此贴子已经被作者于2024/12/24 12:05:53编辑过]