1

I am using the box/spout library for exporting simple Excel files and it is no longer maintained and I wonder what solution I should choose for the current and also future projects. Box/spout was much faster than the library I used before and as long as you don't need fancy formatting it did, what was needed and in a sufficient fast way.

I wonder which library to use instead now. An export to csv isn't an option since my users are used to the comfort of an Excel file and most are not able to open a csv file in Excel and convert it to Excel format.

I am currently using Symfony 5 and php8.1 in an Alpine Linux container

I know it isn't a direct code question, but I would be glad to know your experience or approach to excel exports in the year 2022.

P.S.: Before I used PHPExcel which was very slow, when you had many rows to export. It got a major refactoring and is now called PhpSpreadsheet but I don't know if they fixed the performance issues with many rows

Calamity Jane
  • 2,189
  • 5
  • 36
  • 68
  • https://www.tldevtech.com/best-php-libraries-to-work-with-excel/ – Calamity Jane Oct 06 '22 at 14:06
  • Here the performance Issues are mentioned: https://stackoverflow.com/questions/50731704/building-very-large-spreadsheet-with-phpspreadsheet – Calamity Jane Oct 06 '22 at 14:49
  • 5
    Nice: There seems to be a community fork of box/spot called openspout: https://github.com/openspout/openspout and it seems that it is maintained – Calamity Jane Oct 06 '22 at 14:51
  • 1
    Hi! Recommendation questions are officially off-topic on Stack Overflow. See https://stackoverflow.com/help/on-topic – IMSoP Oct 06 '22 at 16:44

2 Answers2

2

If your xlsx file is simple, see

https://github.com/shuchkin/simplexlsxgen

One file, pure php. Works on php 5.6, 7.x, 8.x

SimpleXLSXgen is not as big nor slow nor feature rich as phpExcel / phpSpreadsheet but it is fine for reports saves as files or for direct downloads

But if you need font type or font size per cell basics, formatting, et. al, then SimpleXMLXgen is not for you. These features are only at workbook level

2

FastExcelWriter is very fast and simple. It works with php 8.1 and uses minimum memory. You can set font, colors, borders and other formatting style for output spreadsheets

aVadim
  • 84
  • 2