Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which gem support Import/Export to xlsx file in ruby [closed]

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?

like image 499
user569445 Avatar asked Jan 10 '11 06:01

user569445


4 Answers

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.

like image 178
Jedidiah Hurt Avatar answered Sep 24 '22 05:09

Jedidiah Hurt


You can try this gem

https://github.com/harvesthq/simple_xlsx_writer

And

https://github.com/cxn03651/writeexcel/

like image 31
fl00r Avatar answered Sep 24 '22 05:09

fl00r


seems RubyXL does both, read AND write https://github.com/gilt/rubyXL haven't used it yet though..

like image 21
andistuder Avatar answered Sep 22 '22 05:09

andistuder


An XLSX file is essentially a zipped collection of XML files. If you don't find suitable gem, you may try generating them manually using Ruby, possibly using an empty template saved from Excel. We used to do that, worked pretty well, unfortunately that code is not open-sourced.

But eventually, we needed more control over how the result looks so we made .NET based solution with Excel automation.

like image 26
Mladen Jablanović Avatar answered Sep 23 '22 05:09

Mladen Jablanović