This project has moved. For the latest updates, please go here.

Row out of range when exporting large amounts of data

Oct 17, 2013 at 1:35 PM
Hello,

First fo all I would like to thank You for this greate library - it's easy to use and efficient.
In my work I encountered a following problem:

I have a collection of data, and I was using LoadFromColletcion method to dump that data into the WorkSheet. It was working fine for relatively small amounts of data. Whe the number of elements in the collection reaches 10 mln and above I receive "Row out of range" ArgumentException from that method. It throwed that exception both when I passed the whole collection to that method and when I used paging. The stack trace is as follows:
   at OfficeOpenXml.ExcelRange.ValidateRowCol(Int32 Row, Int32 Col)
   at OfficeOpenXml.ExcelRange.get_Item(Int32 Row, Int32 Col)
   at OfficeOpenXml.ExcelRangeBase.LoadFromCollection[T](IEnumerable`1 Collection, Boolean PrintHeaders, TableStyles TableStyle, BindingFlags memberFlags, MemberInfo[] Members)
The method invocation looks as follows:
with paging:
sheet.Cells[skipIndex + 2, 1].LoadFromCollection<T>(dataChunk, false,
                    OfficeOpenXml.Table.TableStyles.Medium1,
                    System.Reflection.BindingFlags.Public,
                    propertiesInfo.ToArray());
without paging:
sheet.Cells[2, 1].LoadFromCollection<T>(dataList, false,
                    OfficeOpenXml.Table.TableStyles.Medium1,
                    System.Reflection.BindingFlags.Public,
                    propertiesInfo.ToArray());
I spent quite some time on searching for the reason of this issue with no success so any help will be much appreciated.
I searched that forum for any thread to post my question, but I couldn't find any that addressed my issue.

Thank You in advance for all answers.

Best regards,
Michal