export_to_spreadsheet plugin for Rails

Earlier in this blog, we discussed the possibility of using Apache POI (and its spreadsheet generation features) with Ruby via RJB. Today, Nimble Apps is happy to announce the release of its export_to_spreadsheet plugin for Rails.

This plugin will allow you to generate Excel or Google spreadsheets from a Rails application easily.

The official project page (documentation included) is located on GitHub :

https://github.com/nimbleapps/export_to_spreadsheet

You can also install the plugin from RubyGems :

gem install export_to_spreadsheet

A sample app using the plugin is available at the following address :

https://github.com/nimbleapps/export_to_spreadsheet_sample_app

We are looking forward to your feedback on this plugin and hope some of you will contribute and enhance it !

Using Apache POI with Ruby to generate Excel spreadsheets

In my last post I introduced Apache POI for generating Microsoft Office files, as well as RJB, a Ruby to Java bridge. Today I would like to explain how to use these tools to generate Excel files.

Apache POI handles both the old Excel file format (from Excel 97 to 2007) and the new OOXML format. This article only deals with the first one.

For a full overview of Apache POI’s features you can browse the offical website and the related Java documentation.

[...]

OS backup strategy using EC2 AMI tools

This article is linked to the previous article Your Data In the Cloud. This backup strategy is available for both instance root types. It was nevertheless originally designed to backup an instance whose root device was instance-store. If you intend to backup an EBS-backed AMI instance, please note that this process will create an S3-backed AMI that we will convert back to EBS afterwards. The main advantage of this solution is the ability to download your backup. [...]

OS backup strategy using AWS Management Console

This article is linked to the previous article Your Data In the Cloud. The following backup strategy is only available for instances whose root devices are stored on EBS. With AWS Management Console, you can graphically create an AMI from your instance; this will allow you to backup all its volumes. You can also backup independently some volumes using snapshots. [...]

Your Data in the Cloud

The main goal of cloud computing is to deliver IT infrastructure as a service, i.e. to supply computational resources as if they were electricity or water. Amazon Web Services (AWS) is one of the companies committed to this goal.

However, a provider’s commitment to the goal of cloud computing doesn’t mean that your data is safe in that particular cloud. Notably, the elements listed bellow could lead to damaging data losses :

  • Human mistakes : we believe this risk to be more important with AWS than with a standard hosting solution. For example, you could easily stop an instance whose root device is instance-store, which would lead to a complete system deletion. Terminating by mistake an ongoing instance with the AWS management console is, in our opinion, too easy. However, AWS Identity and Access Management (IAM) (still in Beta) could assuage some of those problems.
  • Server security weakness : in AWS, as the server used for computation purposes is the one you are building; you are thus accountable for its security. Note that Amazon does provide some advice to prevent your server and your data from being compromised.
  • Application vulnerabilities : Unexpected bugs could lead to data modification / deletion.

Amazon’s great SLA is about delivering computation, network, storage… not data security nor backup plans. [...]

How to generate Excel and PowerPoint files from Ruby (and a hint of Java)

There are not many ways to generate Excel files readable on all Office versions, especially using Ruby:
- the “spreadsheet” gem;
- the OLE automation tools Microsoft provides (“Win32OLE” library);
- an appropriate library in another language (such as Apache POI – which can also produce PowerPoint files – or JExcel API, both written in Java).

The “spreadsheet” gem

This gem is only compatible with Ruby 1.8 (1.9 support is planned for the 1.0 version of the module) and hasn’t been updated since February 2010 on the author’s personal git and September 2009 for the public version.

This prevents the upgrade to Ruby 1.9. Moreover, this gem does not support (yet) formulas and images.

If these two issues do not bother you, spreadsheet may be the right tool for you. It seems to work fine but I don’t know if it handles cell formatting. [...]