0
我的水晶報表出現問題,導出爲excel。如果您導出的文件已存在,是否有人可以幫助我如何編寫代碼或任何建議代碼?例如你導出lotinfo,接下來是lotinfo2,然後lotinfo3等,我的代碼總是導出單個文件和單個名稱。excel中的水晶報表導出
私人小組的button1_Click(BYVAL發件人爲System.Object的,BYVALË作爲System.EventArgs)把手Button1.Click
Try
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New _
DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New ExcelFormatOptions
CrDiskFileDestinationOptions.DiskFileName = _
"c:\Lot Enterprise Information.xls"
CrExportOptions = crypt.ExportOptions
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.Excel
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
crypt.Export()
MessageBox.Show("LOT ENTERPRISE INFORMATION IS SUCCESSFULLY EXPORTED!, LOCATED AT DRIVE C:", "PLEASE CHECK AT DRIVE C:", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MsgBox("Please Select Specific date to convert!")
'MsgBox(ex.ToString)
End Try
End Sub
我試圖複製粘貼你的代碼,但有一個錯誤返回'文件'沒有聲明。對不起,我只是一個初學者。 T_T – user3221790
把它放在代碼的最上面。 '進口System.IO' – Codemunkeee
哦,這個文件我進口system.io,但仍然同樣的問題,沒有lotinfo 2 lotinfo 3 – user3221790