Saturday, December 3, 2011

Excel With Ruby and Ruby on Rails

It happened, didn't it? Some client asked you if they could get all that great data you are generating in an excel spreadsheet because they need to share it with their colleagues, or perform further analysis.
You probably went the easy route first - csv - and they complained. The dates are wrong, the leading '0's are missing, the percentage data is a string. You should not be too surprised.   Comma-separated values are old technology and pre-date personal computers by more than a decade.

There are already few gems out there for generating excel data that let you modify an excel workbook but they all seem to missing a few key components. We need multiple sheets, formatting, styling, automated column widths, charts in excel, validation, and support for non-ascii text.

And now we have it.

 axlsx and its rails plugin acts_as_xlsx

For those of you who actually look at the gems you are installing, start with the README's
http://github.com/randym/axlsx
http://github.com/randym/acts_as_xlsx

Every method covered in specs, every method with docs and always green on travis.ci.
well, usually green....

No comments:

Post a Comment