你好!
开发的电脑上可以正确导出Excel,但客户端导出报错,代码段如下,运行报错如图
Dim strExportFile As String
With SaveFileDialog
.Filter="Excel File(*.xlsx)|*.xlsx|All File(*.*)|*.*"
.ShowDialog()
strExportFile=.FileName.ToString
If strExportFile="" Then
GoTo Exit_This_Sub
End If
If Dir(strExportFile)<>"" Then
Kill(strExportFile)
End If
Dim xls As New GrapeCity.ActiveReports.Export.Excel.Section.XlsExport
xls = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport()
xls.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx
xls.Export(viewer1.Document, strExportFile)
MessageBox.Show("Export success.","Info")
End With
|