Created
June 27, 2012 16:00
-
-
Save chsh/3005035 to your computer and use it in GitHub Desktop.
Example for Axslx (xlxs generator modudle)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'axlsx' | |
| rows = [ | |
| [1, "abc", Date.parse('2012/6/28')], | |
| [2, "xyz"] | |
| ] | |
| pkg = Axlsx::Package.new | |
| pkg.workbook do |wb| | |
| wb.add_worksheet(name: 'Sheet1') do |ws| | |
| rows.each do |row| | |
| ws.add_row row | |
| end | |
| end | |
| end | |
| pkg.serialize "file.xlsx" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment