0

I'm using the Axlsx gem to create an excel file and I'd like to add an image. I am currently able to add an image but it seems to add the image in a way that makes it float on top of other content.

I'd like it to exist within a cell. Is this possible?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
rmontgomery429
  • 14,660
  • 17
  • 61
  • 66

1 Answers1

3

It is an old question but we never know.

There is an answer in this post : Adding image to Excel file generated by Axlsx.?

You can specify the cell from which you want to put the image by using image.start_at

sheet.add_image(:image_src => img, :noSelect => true, :noMove => true,   :hyperlink=>"http://axlsx.blogspot.com") do |image|
  image.width = 7
  image.height = 6
  image.hyperlink.tooltip = "Labeled Link"
  image.start_at 2, 2
end

HTH

Community
  • 1
  • 1
Michael A.
  • 2,288
  • 1
  • 18
  • 21