Unfortunately, Excel format is required for the project I am working on. I have no problems getting the data I need in objects and arrays, and currently PHPExcel is doing handling the document generation. It works, but it's slow and loopy. Was wondering if there is a more efficient server language to generate Excel documents (not CSVs).

This is a pure Linux environment so I need to stay away from .NET. I am open to any programming language that does it cleanly and efficiently.

  • 5
    Why does pure linux environments need to avoid .NET? Mono has come a long way as of late. Also, do you really need excel format? Most places can load csv into excel and be happy with that. – Telastyn Dec 15 '12 at 1:08
  • Please take my word for it on this one. Excel is required. – Honus Wagner Dec 15 '12 at 1:10
  • How much money are you willing to spend? LibXL looks to do what you need, it's $199 per developer for a Linux version. – Carson63000 Dec 15 '12 at 1:50

.xlsx files are actually XML so you can use most any language out there. Perl's CPAN seems to have a number of options for instance. Most of it is going to boil down to how much money you want to spend vs completeness of the open source modules/ability to write your own compiler.

  • I work for a big company, money is not an issue. I migrated off of Perl when I took on the project to PHP because it was heavy on the web side. Now, I've rearchitected the project to interact on the web in HTML/Javascript and leave the heavy-duty processing (XLSX creation) to the server without regard to web output. Perhaps now Perl is back on the table. – Honus Wagner Dec 17 '12 at 16:35

There are several libraries available in the Java world, the most popular being Apache POI I believe, which is an open source library that enables you to read and write Excel files (officially supports versions 97 to 2007 but should work fine with 2010 too).

  • 1
    2007 files are 2010 files -- no format changes there. – Wyatt Barnett Dec 15 '12 at 19:44
  • I was not 100% sure. Thanks for the comment. – assylias Dec 15 '12 at 23:22

As others already said, xlsx is nothing but bunch of zipped XMLs, and there is (some) documentation online, so it's not big deal making it by hand. Anyways, there are lots of libraries around for different languages. We are using Ruby and there is a nice library called axlsx. We also brewed our own, called spreadshoot (more DSL-ish), but it's far from finished and not documented yet.


Try Perl's Spreadsheet::WriteExcel. The Developer, John McNamara, sometimes hangs out on stackoverflow.com.

I'm using the module for my own projects, it's really fast even for large files > 65000 rows. You cannot open pre-existing files and update data. You must start out with an empty XLSX file that you can fill up with data and/or formulas. You can append data from many files as long the newly created file is open in-memory. (I have never tried to embed OLE documents and more complex objects in the XLSX files, though )

  • The PHP library I'm using seems to come with a lot of processing overhead. Perhaps I should move that part of the project back to Perl. The PHP code works just fine, its just slow and memory intensive. – Honus Wagner Dec 17 '12 at 16:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.