Universal handler for spreets.
Compatible with Ruby ≥ 1.9.2.
This gems is a handler for spreadsheets. With its independent API, it is possible to create, update files in some formats. Today the list is not very long:
CSV: UTF-8 with commas (Read & Write)
CSV for Excel: CP1252 with semicolons (Read & Write)
ODS: Open Document Format (Read & Write with restrictions)
gem install spreet
How to use it
# Create a new document doc = ::. sheet = doc.sheets.add "My Sheet" # Coordinates can be called with spreadsheet style... sheet["A1"] = "Last name" # ...or more classic style... sheet[1,0] = "First name" # ...or if necessary as a Hash sheet[x: 2, y: 0] = "Born on" sheet.next_row for person in People.all sheet.row person.last_name, person.first_name, person.born_on end # Write it as a classic CSV sheet.write("people-1.csv") # Write it as a CSV for Excel sheet.write("people-2.csv", :format=>:xcsv) # CSV for Excel # or write it as an Open Document Spreadsheet sheet.write("people-3.ods") # Read an existing document doc = ::.("doc.ods")
Add style management for cells
PDF Writer like LibreOffice would make it