这个导出报表代码错在哪儿,老是提示“统考学生成绩表(道科信).xls”已打开。如果九个科目全在的话,提示两次,
如果少语数英,就提示一次,再少了音乐体育美术,就不提示。
If DataTables.Contains("统考水平表") Then
For Each c As Col In Tables("统考水平表").cols
' output.show(c.name & " " & c.caption)
If c.name = "语文" Or c.name = "数学" Or c.name = "英语" Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\统考学生成绩表.xls")
Dim fl As String = ProjectPath & "Reports\统考学生成绩表.xls"
Book.Build()
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
Else
If c.name = "音乐" Or c.name = "美术" Or c.name = "体育" Then
Dim Books As New XLS.Book(ProjectPath & "Attachments\统考学生成绩表(音体美).xls")
Dim fls As String = ProjectPath & "Reports\统考学生成绩表(音体美).xls"
Books.Build()
Books.Save(fls)
Dim Procs As New Process
Procs.File = fls
Procs.Start()
Else
If c.name = "道德与法治" Or c.name = "科学" Or c.name = "信息技术" Then
Dim Booka As New XLS.Book(ProjectPath & "Attachments\统考学生成绩表(道科信).xls")
Dim fla As String = ProjectPath & "Reports\统考学生成绩表(道科信).xls"
Booka.Build()
Booka.Save(fla)
Dim Proca As New Process
Proca.File = fla
Proca.Start()
End If
End If
End If
Next
Else
Messagebox.show("请生成_统考水平表!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If