Which gem support Import/Export to xlsx file in ruby

user569445 picture user569445 · Jan 10, 2011 · Viewed 29.2k times · Source

I need to read and write to Excelx file with ruby code, Tried with spreadsheet it does not support xlsx format, Roo is also to read the file and not write to xlsx.

Is there any gem/plugin which will write to Excelx?

Answer

Jedidiah Hurt picture Jedidiah Hurt · Mar 20, 2012

For the task of writing/exporting xlsx files, Axlsx is the most feature complete library I've found. It does not support reading/importing xlsx files, though.

https://github.com/randym/axlsx

Here's the author's description:

xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.