Ruby on Rails
Rails XLS Plugin

Generate XLS documents through the use of ”.rxls” views.

Dependencies

INSTALLATION INSTRUCTIONS

Usage

Example Objective: You want to generate a downloadable Excel workbook called mydoc.xls

END of EXAMPLE

  1. For large Worksheet documents
  2. To overcome YAJB’s out of process call overhead, a custom Java Helper is bundled with this plugin. This gives pretty much a very fast method to write cells.
  1. Use CellBatch to batch the cell inserts/updates
  2. Use RowGroupBatch to batch the row grouping calls
  1. When only single sheet is present, the cell as well as row group changes are applied at once aumatically as a single Batch call using a custom java Helper function
  1. When multiple sheets are present, after doing the sheet specific cell as well as group operations call CellBatch.write_to(sheet_object) for cell updates. Call RowGroupBatch.group_rows(sheet_object) to apply rowGroupings.
  1. See cell_batch.rb code for options on setting formula cells.

CellBatch.add(5,1,”Row 6 col 1”)
CellBatch.add(5,2,”Row 6 col 2”)
CellBatch.add(7,1,”Row 8 col 1”)
CellBatch.add(8,2,”Row 9 col 2”)
RowGroupBatch.add(7,8)
CellBatch.add(9,1,”Two rows above is grouped”)

Additional POI Usage Information

See Jakarta POI Project Home Page below for a quick guide on POI Usage

http://jakarta.apache.org/poi/hssf/index.html

Jakarta POI API Doc link is given below:

http://jakarta.apache.org/poi/apidocs/index.html?org/apache/poi/hssf/usermodel/package-summary.html

Homepage:

http://rubyforge.org/projects/railsxls/

Install with:

ruby script/plugin install svn://rubyforge.org//var/svn/railsxls/trunk/

See also Plugins