Library to create ODF Spreadsheet files
Ruby
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
samples
MIT-LICENSE
README

README

Spreadsheet
===========

Library to generate OpenDocument Spreadsheet documents.

Example
=======

  sheet = Spreadsheet::Builder.new
  sheet.spreadsheet do
    sheet.table 'Time report (simple)' do
      sheet.row {
        sheet.cell 'Developing spreadsheet library'
        sheet.cell 80.0
      }
      sheet.row {
        sheet.cell 'Writing spreadsheet library documentation'
        sheet.cell 2.0
      }
    end
  
    sheet.table 'Time report (rich)' do
      sheet.column :width => '4in'
      sheet.column :width => '0.5in'
    
      sheet.header {
        sheet.row {
          sheet.cell 'Time report', :span => 2, :style => 'title'
        }
        sheet.row {
          sheet.cell 'Activity', :align => :left
          sheet.cell 'Hours'
        }
      }
    
      sheet.row {
        sheet.string_cell 'Developing spreadsheet library'
        sheet.numeric_cell 80.0
      }
      sheet.row {
        sheet.string_cell 'Writing spreadsheet library documentation'
        sheet.numeric_cell 2.0
      }
    end
  end

  File.open('time_report.ods', 'wb') { |f| f.write sheet.content! }


Copyright (c) 2009 Maxim Kulkin, released under the MIT license