class Axlsx::RowBreaks

A collection of break objects that define row breaks (page breaks) for printing and preview

Public Class Methods

new() click to toggle source
Calls superclass method Axlsx::SimpleTypedList::new
# File lib/axlsx/workbook/worksheet/row_breaks.rb, line 7
def initialize
  super Break
end

Public Instance Methods

add_break(options) click to toggle source

Adds a row break @param [Hash] options The options for the break to be created. max and man values are fixed. @see Break

# File lib/axlsx/workbook/worksheet/row_breaks.rb, line 15
def add_break(options)
  # force feed the excel default
  self << Break.new(options.merge(:max => 16383, :man => true))
  last
end
to_xml_string(str='') click to toggle source

<rowBreaks count=“3” manualBreakCount=“3”> <brk id=“1” max=“16383” man=“1”/> <brk id=“7” max=“16383” man=“1”/> <brk id=“13” max=“16383” man=“1”/> </rowBreaks>

# File lib/axlsx/workbook/worksheet/row_breaks.rb, line 26
def to_xml_string(str='')
  return if empty?
  str << ('<rowBreaks count="' << self.size.to_s << '" manualBreakCount="' << self.size.to_s << '">')
  each { |brk| brk.to_xml_string(str) }
  str << '</rowBreaks>'
end