hi,
We are using Infragistics35.WebUI.UltraWebGrid.ExcelExport.v10.3 version in our Project, Recently we started testing our application in Windows 10 which has Microsoft Excel 2013. When we click on Export to excel button in Win 10 it shows "The file is corrupt and cannot be opened" message. Please suggest any fix for this issue.
Hi Usha,
I am not sure what could cause the exporter to output a corrupt file. Please send a sample application that I can use to recreate the corrupted file and I will be able to debug it to determine the cause.
If you would prefer not to attach your code to the public forum, please let me know and I will open a private case for you.
Hi Mike,
Below is the code snippet that I use for export to excel. This works fine in Windows 7 with Excel 2010. Issue is only with Windows 10 Excel 2013.
Protected WithEvents objExcel As Infragistics.WebUI.UltraWebGrid.ExcelExport.UltraWebGridExcelExporter
Private Sub Excel_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdExcel.Click
Try
objExcel.DownloadName = "G1" & Format(Now(), "MM_dd_yyy")
objExcel.Export(Me.gridview)
Catch ex As Exception
setError(ex.Message)
ExceptionManager.Publish(ex)
End Try
End Sub
Your export code looks pretty simple, so I assume that something has gone wrong during the export. This is likely to be data-dependent, or dependent on another factor. Without a sample, I cannot isolate this issue.
Are you able to send a complete reproduction sample that will generate a corrupted file?
This is the same code which Is generating corrupt file message. I only have this code and the grid used for the export. This same code runs fine in win 7.
I understand that you are running the same code on both Window 7 and on Windows 10, and that this is the entirety of the code. That's why I am asking for a sample -- since the code is basically just a bit of setup and a call to export, I believe the issue must be somewhere else.
Are you able to provide a sample?