Foxtable(狐表)用户栏目专家坐堂 → [求助]多表excel 报表 出错-表单属于其他工作簿


  共有2940人关注过本帖树形打印复制链接

主题:[求助]多表excel 报表 出错-表单属于其他工作簿

帅哥哟,离线,有人找我吗?
方丈
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:811 积分:10934 威望:0 精华:1 注册:2008/9/2 18:58:00
[求助]多表excel 报表 出错-表单属于其他工作簿  发帖心情 Post By:2019/3/1 10:25:00 [显示全部帖子]

多表excel 报表 出错-表单属于其他工作簿
Dim CPMS As List(OF String) = DataTables("订单").GetValues("产品","[产品] is not null")
Dim F1 As String = ProjectPath & "Reports\订单打印.xls"
For Each CPM As String In CPMS
Dim k As Integer = 1
Dim Book1 As New XLS.Book(ProjectPath & "Attachments\订单.xls")
Dim Book2 As New XLS.Book(ProjectPath & "Attachments\订单模板.xls")
Dim Sheet = Book1.Sheets(0)
sheet.name = CPM
Book2.Sheets.Add(Sheet)
'Book2.Sheets.insert(k,Sheet)
Book2.Save(ProjectPath & "Attachments\订单模板.xls")    
Dim Book3 As New XLS.Book(ProjectPath & "Attachments\订单模板.xls") '打开模板
Dim sh2 As XLS.Sheet = Book3.Sheets(k)
   sh2(3,9).Value =" < [产品] = '" & cpm & "' > "     '修改模板,加入筛选条件
k=k+1
Next
Dim Book4 As New XLS.Book(ProjectPath & "Attachments\订单模板.xls") '打开模板
Book4.Build() '生成细节区
Book4.Save(F1) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = F1
Proc.Start()




[此贴子已经被作者于2019/3/1 12:16:32编辑过]

 回到顶部