Merge cells - out of memory issue

Topics: Developer Forum
Feb 28, 2011 at 8:46 AM


I am generating an xls with 6 sheets and with 100 columns and 50 rows for each sheet. Everything it's ok, BUT when I try to merge some cells (every 2 columns, only first 3 rows), I am running out of memory. I can set style on every cell, colors, borders, everything, without running out of memory, it happens only when I try to merge more than 100 cells. PHP memory on my server it's 1024MB, a huge value, for such a small excel file (about 300kb for xlsx). I had try all caching options and everything that I found in documentation, but without succes. What should I do? Thanks

Feb 28, 2011 at 8:29 PM

Merging cells leaves all the original cells still in memory, and only sets a merge list to indicate that they should be treated as a single cell when written to file.

It may help if you merged the cells before actually writing to the (now) single cell.

Feb 28, 2011 at 8:49 PM

Thank you for your answer.

I will try this tommorow morning and I will inform you about results.