I am using 2009.1 and for whatever reason I keep getting that error. There will be 975,170 rows to be exported. I am using the below call and the file saves correctly and is about 60MB, but if I try to open it I get that error and if I say Ok to repair it truncates all the data past the Excel 2003 limit of 65,536 rows. Any ideas?
string sFilename = ("D:\\BUILDS\\ProjectDumps\\overall.xlsx");ultraGridExcelExporter1.Export(ultraGrid1,sFilename,WorkbookFormat.Excel2007);
Hello RMuthu,
RMuthu said: For what we need this method. private void ultraGridExcelExporter1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportInitializeRowEventArgs e) { //export the rows that should be include to the curent sheet if (!(curWorckseet * 65536 <= e.Row.Index && e.Row.Index <= curWorckseet * 65536 + 65536 +1)) { e.SkipRow = true; } } Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
For what we need this method.
private void ultraGridExcelExporter1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportInitializeRowEventArgs e) { //export the rows that should be include to the curent sheet if (!(curWorckseet * 65536 <= e.Row.Index && e.Row.Index <= curWorckseet * 65536 + 65536 +1)) { e.SkipRow = true; } }
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
This method is used to generate and export only the rows in range of current worksheet.
RMuthu said:I have CellExported event in my code. When i do this operation " e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = date;" it throws me the error, saying too many rows when it reach beyond 65536 row index.
CellExport event will not work after the CurrentColumnIndex become out of the valid boundary. So you can use something like that to check for the valid rows.if (0 < e.CurrentRowIndex + headers && e.CurrentRowIndex + headers <= 65536) { e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[3].Value = 9; }I have modified and enhance last sample with these suggestions and to support also header export. I hope this helps.Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Also,
I have CellExported event in my code. When i do this operation " e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = date;" it throws me the error, saying too many rows when it reach beyond 65536 row index. Please advise me.
Code works fine for me. THANKSSSSSS...........
Hello RMuthu, Since there are constantly lots of questions about this - how to export data form grid to Excel2003 and avoid the maximum rows limitation of the excel I have created a simple project showing how to create new sheet when the maximum rows was reached. I hope this is helpful.Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hi,
I'm not entirely sure, but I think what you could do is trap the events on the UltraGridExcelExporter like HeaderExporting and RowExporting and take a look at the CurrentRowIndex in each of these events. If the index starts to get too high, you could change the CurrentWorkSheet to a new worksheet in the excel workbook and set the CurrentRowIndex back to 0 to start at the top of the next worksheet.