Search code examples
officewriter

How to automatically create new worksheet when data exceeds 65536 rows when exporting using OfficeWriter?


I have a report that exceeds 65536 rows of data. From my understanding, correct me if I'm wrong here, Officewriter template can only render this much data (65536), and the remaining rows will be removed. Is there any way to automatically create a new worksheet to the exported excel file to accommodate the remaining rows using Officewriter?


Solution

  • Dave,

    There are a couple ways of doing this.

    1. Use the continue Modifier. The continue modifier will let you overflow your data from one worksheet to another see the documentation here
    2. Use the XLSX file format. Not xls. The 65536 rows you mention is a file format limitation on the xls file format. The XLSX file format easily supports over 1 million rows per a worksheet.
    3. Lastly look at the MaxRows property on DataBindingProperties. I am going by memory and do not have OfficeWriter installed at the moment, but depending on your version of OW there may be a bug. In some versions I believe MaxRows defaults to 65536, so even if you are using XLSX it may appear to get truncated. You can work around this by setting MaxRows to a larger number and using XLSX.

    Hope this helps.