--
With Tables("残疾学生")
Dim dyl_L As List(Of String) = .DataTable.Getvalues("班级")
For Each dyl_ As String In dyl_L
.Filter = "班级 = \'" & dyl_ & "\'"
.SaveExcel("C:\\Users\\Administrator\\Desktop\\数据.xls",dyl_)
Next
MessageBox.Show("已保存在桌面,请查看!","提示") \'提示用户选择的文件
End With
上面的导出到同一个工作簿中的不同工作表
怎么修改让导出到不同的工作簿中?
Dim Products As List(Of String)
Products = DataTables("残疾学生").GetValues("班级")
For Each Product As String In Products
Dim Book As New XLS.Book(ProjectPath & "Attachments\\残疾学生.xls")
Dim fl As String = ProjectPath & "Reports\\信息-" & Product & ".xls"
book.sheets(0)(2,36).value = "<班级=\'" & Product & "\'>"
Book.Build() \'生成细节区
Book.Save(fl) \'保存工作簿
Dim Proc As New Process \'打开工作簿
Proc.File = fl
Proc.Start()
Next
这个虽然可以导出为不同的工作簿,但是结果不对,工作簿除了名称按要求,内容都一样?不知道那点有问题,怎么改?
[此贴子已经被作者于2020/5/19 17:37:06编辑过]