class Oxcelix::FormattedWorkbook
FormattedWorkbook
is a Workbook
that contains the formatted values (strings) of the original Excel cells instead of Cell
objects. The values are taken from the Sheet
arrays by running the #Cell::to_fmt method. The result will be exactly the same as if you ran the #Sheet::to_fmt method, but it will be snappier as the merged cellgroups will not need to be processed.
Private Instance Methods
buildsheet(sheet, options)
click to toggle source
{include:Workbook}
# File lib/oxcelix/workbook.rb, line 378 def buildsheet(sheet, options) ydiff, xdiff = 0,0 if !options[:paginate].nil? ydiff = options[:paginate][0] * (options[:paginate][1]-1) elsif !options[:cellrange].nil? xdiff = x(options[:cellrange].begin) ydiff = y(options[:cellrange].begin) end m=Sheet.build(sheet[:cells].last.y+1-ydiff, sheet[:cells].last.x+1-xdiff) {nil} sheet[:cells].each do |c| m[c.y-ydiff, c.x-xdiff] = c.to_fmt end return m end