$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/
rubygem之生成xlsx文件
猜你喜欢
转载自schooltop.iteye.com/blog/2241627
今日推荐
周排行