开发者

How to Write hyperlinks using spreadsheet gem in Ruby?

开发者 https://www.devze.com 2023-01-08 23:24 出处:网络
The spreadsheet gem isnt documented properly, so I cant understand how can I write hyperlinks using sprea开发者_如何学编程dsheet gem. Can anyone tell me?This script will create a spreadsheet with a li

The spreadsheet gem isnt documented properly, so I cant understand how can I write hyperlinks using sprea开发者_如何学编程dsheet gem. Can anyone tell me?


This script will create a spreadsheet with a link in the first cell

require 'rubygems'
require 'spreadsheet'

book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet
sheet1[0,0] = Spreadsheet::Link.new 'www.google.com', 'link text'
book.write '/tmp/spreadsheet_with_link.xls'


According to the Guide you have to write to a new file name: https://github.com/zdavatz/spreadsheet/blob/master/GUIDE.md

0

精彩评论

暂无评论...
验证码 换一张
取 消