Hi,
When I try to open excel file generated using Infragistics.Excel - I am getting below exception....
"Excel found unreadable content in 'filename.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, Click Yes"
After Repaired it shows in repair log - "Repaired Records: Worksheet properties from /xl/worksheets/sheet1.xml part"
After my analysis on the issue i found below line of code causing the issue.
workSheet.PrintOptions.InsertPageBreak(workSheet.Rows[headerRow]);
Part of my code FYR...
workSheet.PrintOptions.InsertPageBreak(workSheet.Columns[reportSet.Tables[0].Columns.Count]);
workSheet.PrintOptions.Orientation = Infragistics.Documents.Excel.
Orientation.Landscape;
workSheet.PrintOptions.PaperSize =
PaperSize.Legal;
workSheet.PrintOptions.LeftMargin = 0.2;
workSheet.PrintOptions.RightMargin = 0.2;
workSheet.PrintOptions.ScalingFactor = 72;
I'm not sure what you are referring to when you say "version4" or "version5". Are you talking about the version of the Infragistics assemblies? The xlsx format is also known as Office2007 format, which (obviously) came out in 2007. If you are using Infragistics version 5, that means it was released in 2005, before Office2007 was released.
Support for Office2007 format was added to the Infragistics suite in 2008. So that was probably Infragistics v8.2 or maybe 9.1.
i wanted to export data to excel. as of now i am using infragistics4 version. but i am able to create only .xls files. but my requirement is to create .xlsx files. can i create .xlsx files by using version4? or switch to verion 5?
Please send me the code snippet if possible
Your quick response would be highly appriciated
- Satya.P
Have you been able to resolve your issue ? If you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.
Regards
Here is the sample
Hello vbalingula,
Could you please take a look at the attached sample and video file where I create 100 000 rows and export it in a excel file. Also please note that you should use WorkbookFormat Excel 2007 for example:
Infragistics.Documents.Excel.Workbook wb = new Infragistics.Documents.Excel.Workbook(Infragistics.Documents.Excel.WorkbookFormat.Excel2007);
with Infragistics4.Documents.Excel.v12.1 assembly and latest available service release.
Please take a look at the video file for more details.