I was searching Ruby toolbox for a popular, well-supported tool to generate XSLX (Excel 2007 and on) document, but I didn't manage to find anything. I also spent a good amount of time searching on Google, but most of the answers I found seem outdated.
I'll need to include inline images in the document I generate.
I'm working with Ruby 1.9.2 and Rails 3.
Any suggestions?
Thank you very much!
Open or select the workbook that contains the data that you want to publish. To save only part of the data on a sheet as a webpage, select the data that you want to save. On the File menu, click Save as Web Page.
Bit late to the game, but there you go. You should use the axlsx gem
On Github: https://github.com/randym/axlsx
On Rubygems: https://rubygems.org/gems/axlsx
On Rubytookbox: https://www.ruby-toolbox.com/projects/axlsx
From the README
p = Axlsx::Package.new
p.workbook do |wb|
wb.add_worksheet(:name => "Image with Hyperlink") do |sheet|
img = File.expand_path('../image1.jpeg', __FILE__)
sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image|
image.width=720
image.height=666
image.hyperlink.tooltip = "Labeled Link"
image.start_at 2, 2
end
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With