class Axlsx::Xf

The Xf class defines a formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style @see Styles#add_style

Attributes

alignment[R]

The cell alignment for this style @return [CellAlignment] @see CellAlignment

applyAlignment[R]

Indicates if the alignment options should be applied @return [Boolean]

applyBorder[R]

indicates if the borderId should be applied @return [Boolean]

applyFill[R]

indicates if the fillId should be applied @return [Boolean]

applyFont[R]

indicates if the fontId should be applied @return [Boolean]

applyNumberFormat[R]

indicates if the numFmtId should be applied @return [Boolean]

applyProtection[R]

Indicates if the protection options should be applied @return [Boolean]

borderId[R]

index (0 based) of the border to be used in this style @return [Integer]

fillId[R]

index (0 based) of the fill to be used in this style @return [Integer]

fontId[R]

index (0 based) of the font to be used in this style @return [Integer]

numFmtId[R]

id of the numFmt to apply to this style @return [Integer]

pivotButton[R]

indicates if the cell has a pivot table drop down button @return [Boolean]

protection[R]

The cell protection for this style @return [CellProtection] @see CellProtection

quotePrefix[R]

indecates if text should be prefixed by a single quote in the cell @return [Boolean]

xfId[R]

index (0 based) of cellStylesXfs item to be used in this style. Only applies to cellXfs items @return [Integer]

Public Class Methods

new(options={}) click to toggle source

Creates a new Xf object @option options [Integer] numFmtId @option options [Integer] fontId @option options [Integer] fillId @option options [Integer] borderId @option options [Integer] xfId @option options [Boolean] quotePrefix @option options [Boolean] pivotButton @option options [Boolean] applyNumberFormat @option options [Boolean] applyFont @option options [Boolean] applyFill @option options [Boolean] applyBorder @option options [Boolean] applyAlignment @option options [Boolean] applyProtection @option options [CellAlignment] alignment @option options [CellProtection] protection

# File lib/axlsx/stylesheet/xf.rb, line 26
def initialize(options={})
  parse_options options
end

Public Instance Methods

alignment=(v) click to toggle source

@see Xf#alignment

# File lib/axlsx/stylesheet/xf.rb, line 97
def alignment=(v) DataTypeValidator.validate "Xf.alignment", CellAlignment, v; @alignment = v end
applyAlignment=(v) click to toggle source

@see applyAlignment

# File lib/axlsx/stylesheet/xf.rb, line 128
def applyAlignment=(v) Axlsx::validate_boolean v; @applyAlignment = v end
applyBorder=(v) click to toggle source

@see applyBorder

# File lib/axlsx/stylesheet/xf.rb, line 125
def applyBorder=(v) Axlsx::validate_boolean v; @applyBorder = v end
applyFill=(v) click to toggle source

@see applyFill

# File lib/axlsx/stylesheet/xf.rb, line 122
def applyFill=(v) Axlsx::validate_boolean v; @applyFill = v end
applyFont=(v) click to toggle source

@see applyFont

# File lib/axlsx/stylesheet/xf.rb, line 120
def applyFont=(v) Axlsx::validate_boolean v; @applyFont = v end
applyNumberFormat=(v) click to toggle source

@see applyNumberFormat

# File lib/axlsx/stylesheet/xf.rb, line 118
def applyNumberFormat=(v) Axlsx::validate_boolean v; @applyNumberFormat = v end
applyProtection=(v) click to toggle source

@see applyProtection

# File lib/axlsx/stylesheet/xf.rb, line 131
def applyProtection=(v) Axlsx::validate_boolean v; @applyProtection = v end
borderId=(v) click to toggle source

@see borderId

# File lib/axlsx/stylesheet/xf.rb, line 110
def borderId=(v) Axlsx::validate_unsigned_int v; @borderId = v end
fillId=(v) click to toggle source

@see fillId

# File lib/axlsx/stylesheet/xf.rb, line 108
def fillId=(v) Axlsx::validate_unsigned_int v; @fillId = v end
fontId=(v) click to toggle source

@see fontId

# File lib/axlsx/stylesheet/xf.rb, line 106
def fontId=(v) Axlsx::validate_unsigned_int v; @fontId = v end
numFmtId=(v) click to toggle source

@see numFmtId

# File lib/axlsx/stylesheet/xf.rb, line 103
def numFmtId=(v) Axlsx::validate_unsigned_int v; @numFmtId = v end
pivotButton=(v) click to toggle source

@see pivotButton

# File lib/axlsx/stylesheet/xf.rb, line 116
def pivotButton=(v) Axlsx::validate_boolean v; @pivotButton = v end
protection=(v) click to toggle source

@see protection

# File lib/axlsx/stylesheet/xf.rb, line 100
def protection=(v) DataTypeValidator.validate "Xf.protection", CellProtection, v; @protection = v end
quotePrefix=(v) click to toggle source

@see quotePrefix

# File lib/axlsx/stylesheet/xf.rb, line 114
def quotePrefix=(v) Axlsx::validate_boolean v; @quotePrefix = v end
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

# File lib/axlsx/stylesheet/xf.rb, line 136
def to_xml_string(str = '')
  str << '<xf '
  serialized_attributes str
  str << '>'
  alignment.to_xml_string(str) if self.alignment
  protection.to_xml_string(str) if self.protection
  str << '</xf>'
end
xfId=(v) click to toggle source

@see xfId

# File lib/axlsx/stylesheet/xf.rb, line 112
def xfId=(v) Axlsx::validate_unsigned_int v; @xfId = v end