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;
Hello vbalingula,
Thanks for provided code. I try to reproduce your issue using your code and our latest available version: 12.1.20121.2054, but I think that everything works properly. I made small sample and few test, but I`m not able to reproduce your issue. Could you please tell me what is your current version and do you have any installed service release and which one.
Also please take a look at the attached sample and video file for more details and let me know if you think that I didn`t reproduce your scenario. Please feel free to modify this sample to re[produce your issue and revert it back to me. I`ll be glad to research it for your.
Let me know if you have any questions.
Regards
Hello,
Thank you for your quick reply and sample code.
Sorry I forgot to mention - but I noticed that when I have rows fewer then 65K I don’t see that issue but more then that it started causing the issue!
Hello Georgi,
My current installed version - 12.1.20121.2038
I'm still having the same issue, in the meantime to resolve the issue I commented the below line which causing the issue...
Can you please try creating the excel file dynamically and also add data at runtime and format – Insert Page break at rows/column level. As I said earlier I’m seeing this issue when I’m having more than 65k rows in my output excel file.
Thanks
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.
Here is the sample
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.
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
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.