class Axlsx::Workbook
The Workbook
class is used to manage the Excel file in memory.
Attributes
package[RW]
Public Instance Methods
predefined_styles()
click to toggle source
Gets the predefined style list.
The predefined_styles
hash contains :bold, :date, :float, :integer, :percent, :currency, :text, :wrapped, and :normal styles for you to use.
# File lib/barkest_core/extensions/axlsx_extenstions.rb, line 50 def predefined_styles @predefined_styles ||= begin tmp = {} styles do |s| tmp = { bold: s.add_style(b: true, alignment: { vertical: :top }), date: s.add_style(format_code: 'mm/dd/yyyy', alignment: { vertical: :top }), float: s.add_style(format_code: '#,##0.00', alignment: { vertical: :top }), integer: s.add_style(format_code: '#,##0', alignment: { vertical: :top }), percent: s.add_style(num_fmt: 9, alignment: { vertical: :top }), currency: s.add_style(num_fmt: 7, alignment: { vertical: :top }), text: s.add_style(format_code: '@', alignment: { vertical: :top }), wrapped: s.add_style(alignment: { wrap_text: true, vertical: :top }), normal: s.add_style(alignment: { vertical: :top }) } end tmp end end