Thursday, April 5, 2012

Excel file generation with Ruby, JRuby and Rubinius, multiple charts, styles and print options.

Over the last three or four months, amazing things have happened and I have simply been scrambling to keep up. The axlsx and acts_as_xlsx gems have gone far beyond my personal expectations and I need to express my gratitude to the OSS community that has really come to rally around new features, better performance and helping this gem set to stand up and knock every other excel generating gem off the charts.

here is the proof:
https://www.ruby-toolbox.com/categories/reporting

We are going to surpass the download count it took odf-reports to do in more than two years in about five months. I am simply awed. On top of that, we just released support for JRuby and Rubinius.

What I should be doing here is giving everyone lots of examples of how to take advantage of all the amazing features that have been build into axlsx over the last few months like support for named tables, simplified border styling, splatter charts, page margin and print fitting as well as a 7x+ increase in performance.

Unfortunately this also happens to be the beginning of the peak time in my day job as Ops manager at reallyenglish. That means that on a good day I get one or two hours to keep up with github, the great guys at travis-ci and feel guilty about not actually giving examples of the better ways to use axlsx!


So I am going to give some hints!

Serialization:

The gem no longer requires you to write to a temp file thanks to the great guys writing rubyzip.
Use to_stream when you want to serialize your package! But always remember that the download will block! In a poor hardware/high volume situation you always want to move those files off to a separate server!

Stylin'

It's all about workbook.add_style
If you are looking to make a professional report, give it some thought in advance. What styles do you need? It is a lot like CSS. You don't want to be hard coding the style for every element in your web page, and the same applies for axlsx. my_style_for_headers = wb.add_style [insert style hash here] run once will serve you for all worksheets in your workbook.

Charts
Use them, and your clients will love you! dump csv - and your clients will :meh
joekain stepped up out of the blue and brought us splatter plots! I promise you, as a guy who deals directly with many of the top companies in Japan, your clients will love you for it. We eat our own dog food and have had huge amounts of praise for this.

But I think the most important thing of all, even though it is hard to give credit enough, is to express that the list of contributors you will find on github and in the README (which you really should read!) is the first and foremost reason why this gem is rapidly becoming the BEST way to generate excel based reports. It simply could not be done without these guys. To them, I tip my hat and bow at the waist.

so.. THANK YOU <3 <3 <3





No comments:

Post a Comment