Sha256: f5bfaf7461f0068cccc77d8ea7c08ac0c61c00ca54e225f06a2ddac0bbf9ea4c

Contents?: true

Size: 960 Bytes

Versions: 21

Compression:

Stored size: 960 Bytes

Contents

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

#######################################################################
#
# Example of how to hide rows and columns in Excel::Writer::XLSX. In order to
# hide rows without setting each one, (of approximately 1 million rows),
# Excel uses an optimisation to hide all rows that don't have data.
#
# reverse ('(c)'), December 2012, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
#

require 'write_xlsx'

workbook  = WriteXLSX.new('hide_row_col.xlsx')
worksheet = workbook.add_worksheet

# Write some data
worksheet.write('D1', 'Some hidden columns.')
worksheet.write('A8', 'Some hidden rows.')

# Hide all rows without data.
worksheet.set_default_row(nil, 1)

# Set emptys row that we do want to display. All other will be hidden.
(1..6).each { |row| worksheet.set_row(row, 15) }

# Hide a range of columns.
worksheet.set_column('G:XFD', nil, nil, 1)

workbook.close

Version data entries

21 entries across 21 versions & 1 rubygems

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