My application allows exporting database tables to Excel. As I switched to new XLSX format I have noticed that Excel 2007 always requires a file repair before file can be opened.The problem occurs even with very simple data in the test code below:
WorkbooktestWorkbook = new Workbook();testWorkbook.SetCurrentFormat(WorkbookFormat.Excel2007);Worksheet worksheet = testWorkbook.Worksheets.Add("Test Sheet");worksheet.Rows[0].Cells[0].Value = "Test value";testWorkbook.Save(targetFilePath);
If I try to open generated file the first time with Excel 2007, it claims the format is invalid and makes a repair with following repair log summary. (Unfortunately I have a German version of Excel, so the summary text was in German. I have translated it myself, so it might be different from the English version. )
<repairedParts summary="Following repairing has been done:_x000d__x000a__x000d__x000a_"> <repairedPart>Repaired part: /xl/worksheets/sheet1.xml-Part with XML error. Error loading data. Line 11, Column 71.</repairedPart> </repairedParts>
By the way, the generated file can't be opened with Infragistics either:
testWorkbook = Workbook.Load(targetFilePath);
causes System.ArgumentOutOfRangeException is thrown at Infragistics.Excel.WorksheetCollection.get_Item(Int32 index)
If Excel97To2003 workbook format is used, correct xls file is generated and can be opened with Workbook.Load.
Am I doing something wrong or is it a known issue?If it is a known issue, is any hotfix planned? (December Hotfix for Infragistics 8.3 did not help)
Thanks in advance.
DFE
I have not seen this issue and was not able to reproduce it. I think I know what the problem might be though. It looks like the xml data was written out with culture specific separators when it probably should have been written out with constant separators. If you can post the erroneous line from the xml, it would really help in determining what the problem is:
Thanks for your help.
Here is line 11 from sheet1.xml
<sheetFormatPr defaultColWidth="9,140625" defaultRowHeight="12,75" />
Yeah, that's what I thought. It should look like this:
<sheetFormatPr defaultColWidth="9.140625" defaultRowHeight="12.75" />
I would recommend submitting the issue to the support group so you can be notified when the hotfix is released: http://es.infragistics.com/gethelp.
Hi All,
I am using Infragistics 8.3 with .net 3.5. Recently I have changed from .net 2.0 and Infragistics 7.1 because It was not allowing me to export to xlsx format.
After upgrading the version i am able to export to xlsx but I am getting Error While opening the file " Excel found unreadable content in test.xlsx. DO you want to recover the content...." If I say Yes another dialog box coming with the error "Repaired Records: Cell information from /xl/worksheets/sheet1.xml part".
Export to xls is working fine but not xlsx.
Please let me know What could be the reason ?
Regards
I apologize for the delayed response. Version 8.3 is no longer supported but it is possible this is a bug which was already fixed in 8.3. Try upgrading to the latest SR for 8.3 to see if that fixes the issue. If it does not, try upgrading to the latest version instead and let me know if you are still experiencing the issue. Thank you.
Hi Mike,
We are also facing the same error while exporting to xlsx using UltraWebGridExcelExporter. We are using Infragistics 10.3 and Dot net framework 4.5.
We are able to export to xlsx but we are getting error while opening the file "Excel found unreadable content in clienreport.xlsx. DO you want to recover the content....
"If I say Yes another dialog box coming with the error "Repaired Records: Cell information from /xl/worksheets/sheet1.xml part".
But we are able to see the record also the warning message pops up.
Could you please guide us how to fix the issue.
Thanks,
Venkata.
It's hard to say what the issue might be without knowing what is being set/put in the Workbook. The version you are using is a rather old version and the issue you are encountering may well be something that is already addressed in a later version although without knowing what it is being done that is causing that I cannot say for certain. One thing you might try to determine if that is the case is to download the trial version for the latest version and see if you still experience the problem. If not then it would seem that it is already addressed. If you can still get the issue then we need to try and reproduce that here so we can address the issue but that would only be in the versions we currently support. A sample that demonstrates the issue would be best otherwise perhaps providing the invalid xlsx might be a start if that is the case since we could try to determine which part of the xlsx Excel is taking issue with.