Sha256: b9d214c3b01757e615f7c69a92996486aaafba78858190a7d8f84c10af66a2ab

Contents?: true

Size: 1.12 KB

Versions: 21

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

###############################################################################
#
# Example of how to use Excel::Writer::XLSX to write a hyperlink in a
# merged cell.
#
# reverse(c), September 2002, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
#

require 'write_xlsx'

# Create a new workbook and add a worksheet
workbook  = WriteXLSX.new('merge3.xlsx')
worksheet = workbook.add_worksheet()

# Increase the cell size of the merged cells to highlight the formatting.
[3, 6, 7].each { |row| worksheet.set_row(row, 30) }
worksheet.set_column('B:D', 20)

###############################################################################
#
# Example: Merge cells containing a hyperlink using merge_range().
#
format = workbook.add_format(
    :border    => 1,
    :underline => 1,
    :color     => 'blue',
    :align     => 'center',
    :valign    => 'vcenter'
)

# Merge 3 cells
worksheet.merge_range('B4:D4', 'http://www.perl.com', format)


# Merge 3 cells over two rows
worksheet.merge_range('B7:D8', 'http://www.perl.com', format)

workbook.close

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
write_xlsx-1.00.0 examples/merge3.rb
write_xlsx-0.99.0 examples/merge3.rb
write_xlsx-0.97.0 examples/merge3.rb
write_xlsx-0.90.0 examples/merge3.rb
write_xlsx-0.89.0 examples/merge3.rb
write_xlsx-0.88.0 examples/merge3.rb
write_xlsx-0.87.0 examples/merge3.rb
write_xlsx-0.86.0 examples/merge3.rb
write_xlsx-0.85.11 examples/merge3.rb
write_xlsx-0.85.10 examples/merge3.rb
write_xlsx-0.85.9 examples/merge3.rb
write_xlsx-0.85.8 examples/merge3.rb
write_xlsx-0.85.7 examples/merge3.rb
write_xlsx-0.85.6 examples/merge3.rb
write_xlsx-0.85.5 examples/merge3.rb
write_xlsx-0.85.4 examples/merge3.rb
write_xlsx-0.85.3 examples/merge3.rb
write_xlsx-0.85.2 examples/merge3.rb
write_xlsx-0.85.1 examples/merge3.rb
write_xlsx-0.83.0 examples/merge3.rb