Little tool to generate simple MS Excel reports from your AR queries.
Ruby JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.autotest
.document
.gitignore
.rspec
.rvmrc
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
active_record_to_excel.gemspec

README.md

active_record_to_excel

active_record_to_excel is a litle tool for generate simple MS Excel reports based on the results returned from your ActiveRecord queries.

Usage

In your Gemfile:

gem 'active_record_to_excel'

Generating reports:

User.all.to_excel({ :name => 'Name', :email => 'Email' })

That line of code creates a report.xls file under the public folder of your rails app.

The keys on the hash are methods of you ActiveRecord object that returns the value required, the values are the labels of the columns on the Excel sheet.

You can pass optionally two arguments: :filename and :path

User.all.to_excel({ :name => 'Name', :email => 'Email', :path => '~/reports', :filename => 'users.xls' })

It will create a users.xls file in your $HOME/reports directory.

Copyleft

Copyleft (ɔ) 2011 Rubén Dávila