Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Rails plugin to generate xls documents by using rxls templates.
Ruby JavaScript CSS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Gemfile
MIT-LICENSE
README.rdoc
Rakefile
spreadsheet_on_rails.gemspec

README.rdoc

SpreadsheetOnRails

A gem to generate xls documents by using rxls templates.

Based on Defv railsxls plugin without the Java part.

Installation

In Rails 3, add this to your Gemfile and run the bundle command.

gem "spreadsheet_on_rails"

Getting Started

Add support for the new format in your controller:

class HomeController < ApplicationController

  def index
    respond_to do |format|
      format.html
      format.xls { render :xls => "<filename>"}
    end
  end
end

Create an xls view app/views/home/index.rxls:

sheet = workbook.create_worksheet
sheet.name = "What's in a name"

sheet.row(0).concat %w{Name Country Acknowlegement}
sheet[1,0] = 'Japan'
row = sheet.row(1)
row.push 'Creator of Ruby'
row.unshift 'Yukihiro Matsumoto'
sheet.row(2).replace [ 'Daniel J. Berger', 'U.S.A.',
                        'Author of original code for Spreadsheet::Excel' ]
sheet.row(3).push 'Charles Lowe', 'Author of the ruby-ole Library'
sheet.row(3).insert 1, 'Unknown'
sheet.update_row 4, 'Hannes Wyss', 'Switzerland', 'Author'

The view basically allow you to write directly with the spreadsheet gem.

Build Status

Copyright © 2012 10to1, released under the MIT license

Something went wrong with that request. Please try again.