Jonny Flowers
Jonny Flowers

Reputation: 631

Creating large Excel files with PHPExcel

I am trying to create some very large excel documents with PHPExcel however I don't want to have to increase the memory limit within PHP.

Would it be possible to have it write say 100 rows at a time and then save it to disk. That way the whole document doesn't need to be stored in memory.
I am based in AWS so I was thinking of using S3 to store the temporary spreadsheet before it is completed and downloaded to the users computer.

If someone has experience with this method and could provide some guidance that would be great.

Upvotes: 1

Views: 913

Answers (1)

Mark Baker
Mark Baker

Reputation: 212452

No it isn't possible to write 100 rows, then save to disk, then write the next 100 rows and save that to disk (appending it to the original 100 rows)..... Unlike CSV, native format Excel files aren't structured in a simple linear manner

Have you looked at any of the options that PHPExcel provides for reducing memory usage, such as cell caching?

Upvotes: 2

Related Questions