Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question
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
add comment

4 Answers

.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.

share|improve this answer
    
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
add comment

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).

share|improve this answer
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
add comment

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.

share|improve this answer
    
Do you happen to have any links to the documentation you mentioned on generating it myself? –  Honus Wagner Dec 17 '12 at 16:37
    
Umm, this may be a starting point: msdn.microsoft.com/en-us/library/office/… msdn.microsoft.com/en-us/library/office/gg278316.aspx and also Google for "SpreadsheetML" –  Mladen Jablanović Dec 17 '12 at 17:28
add comment

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 )

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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