`

rubygem之生成xlsx文件

    博客分类:
  • RUBY
 
阅读更多
$gem install simple_xlsx_writer
Creating OpenXML files is fairly straight forward:
  require 'rubygems'
  require 'simple_xlsx'

  SimpleXlsx::Serializer.new("test.xlsx") do |doc|
    doc.add_sheet("People") do |sheet|
      sheet.add_row(%w{DoB Name Occupation})
      sheet.add_row([Date.parse("July 31, 1912"),
                     "Milton Friedman",
                     "Economist / Statistician"])
    end
  end


https://www.getharvest.com/blog/2010/08/how-to-generate-excel-files-with-ruby/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics