As we know the max row number allowed in one excel worksheet is 65535.
I want to use UltraGridExcelExporter to export a grid which is with more than 65535 rows to excel but I find that you can only set the StartRow and StartColumn in the Export method. What I want is that you could also set some parameters such as EndRow so I can splite the grid into multi sheets.
Is there any easy solution to this problem?
Well... I don't think the WinGridExcelExporter gives you the object to target Excel 2007 at present.
I don't know of any way to do this right now. What you would probably have to do is break up your data into multiple grids and export each one to a separate worksheet in the same report. You could probably use a single grid and just change it's data source repeatedly and export it in a loop.
You should probably submit this to Infragistics as a feature request (or 2):
Request a Feature or Component
Here is my sample code...
Infragistics.Excel.
Workbook w = new Infragistics.Excel.Workbook();
w.CurrentFormat = Infragistics.Excel.
WorkbookFormat.Excel2007;
this.ultraGridExcelExporter1.FileLimitBehaviour = Infragistics.Win.UltraWinGrid.ExcelExport.FileLimitBehaviour.TruncateData;
this.ultraGridExcelExporter1.Export(this.ultraGrid1, w.Worksheets[this.Text]);
w.Save(.xlsx ) // Save as .xlsx file name.
I have close to 85K rows,so when i open the xlsx file , it has only 65535 rows.
So you are not getting an exception, the data is getting truncated. Whta happens if you do not set the FileLimitBehavior?
If i dont set FileLimitBehavior then i get following message.
Can't export more rows than MaxExcelRowCount. Use FileLimitBehaviour property if you want to change default behaviour.
I have around 93K rows.
File save as .xlsx format.
Hi,
I just tested this out and you are right, the Exception is still occurring. This looks like a bug. I have forwarded this thread over to the Infragstics Developer Support team so they can write it up for developer review and we can get it fxed.
Has this been fixed? I'm getting the same error message.
Looks like this was fixed back in August. Get the latest service release and if you still have a problem, you should Submit an incident to Infragistics Developer Support and include a small sample project demonstrating the issue.
How to get the latest service release - Infragistics Community
Still the same error message.