Class: OoxmlParser::PivotTableDefinition
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::PivotTableDefinition
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb
Overview
Class for parsing <PivotTableDefinition> tag
Instance Attribute Summary collapse
-
#apply_alignment_formats ⇒ True, False
readonly
Should alignment formats be applied.
-
#apply_border_formats ⇒ True, False
readonly
Should border formats be applied.
-
#apply_font_formats ⇒ True, False
readonly
Should font formats be applied.
-
#apply_number_formats ⇒ True, False
readonly
Should number formats be applied.
-
#apply_pattern_formats ⇒ True, False
readonly
Should pattern formats be applied.
-
#apply_width_height_formats ⇒ True, False
readonly
Should width height formats be applied.
-
#cache_id ⇒ Integer
readonly
Id of cache.
-
#column_fields ⇒ RowFields
readonly
Column fields.
-
#column_items ⇒ ColumnRowItems
readonly
Column items.
-
#created_version ⇒ Integer
readonly
Creation version.
-
#data_caption ⇒ String
readonly
Data caption.
-
#data_fields ⇒ DataFields
readonly
Data fields.
-
#indent ⇒ Integer
readonly
Indent.
-
#item_print_titles ⇒ True, False
readonly
Should item print titles.
-
#location ⇒ Location
readonly
Location data.
-
#multiple_field_filters ⇒ True, False
readonly
Is there multiple fields filters.
-
#name ⇒ String
readonly
Name of table.
-
#outline ⇒ True, False
readonly
Outline.
-
#outline_data ⇒ True, False
readonly
Outline data.
-
#page_fields ⇒ PageFields
readonly
Page fields.
-
#pivot_fields ⇒ PivotFields
readonly
Pivot fields.
-
#row_fields ⇒ RowFields
readonly
Row fields.
-
#row_items ⇒ ColumnRowItems
readonly
Row items.
-
#style_info ⇒ PivotTableStyleInfo
readonly
Style info.
-
#use_auto_formatting ⇒ True, False
readonly
Should auto formatting be used.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(file) ⇒ PivotTableDefinition
Parse PivotTableDefinition object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#apply_alignment_formats ⇒ True, False (readonly)
Returns should alignment formats be applied.
27 28 29 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 27 def apply_alignment_formats @apply_alignment_formats end |
#apply_border_formats ⇒ True, False (readonly)
Returns should border formats be applied.
21 22 23 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 21 def apply_border_formats @apply_border_formats end |
#apply_font_formats ⇒ True, False (readonly)
Returns should font formats be applied.
23 24 25 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 23 def apply_font_formats @apply_font_formats end |
#apply_number_formats ⇒ True, False (readonly)
Returns should number formats be applied.
19 20 21 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 19 def apply_number_formats @apply_number_formats end |
#apply_pattern_formats ⇒ True, False (readonly)
Returns should pattern formats be applied.
25 26 27 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 25 def apply_pattern_formats @apply_pattern_formats end |
#apply_width_height_formats ⇒ True, False (readonly)
Returns should width height formats be applied.
29 30 31 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 29 def apply_width_height_formats @apply_width_height_formats end |
#cache_id ⇒ Integer (readonly)
Returns id of cache.
17 18 19 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 17 def cache_id @cache_id end |
#column_fields ⇒ RowFields (readonly)
Returns column fields.
63 64 65 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 63 def column_fields @column_fields end |
#column_items ⇒ ColumnRowItems (readonly)
Returns column items.
51 52 53 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 51 def column_items @column_items end |
#created_version ⇒ Integer (readonly)
Returns creation version.
37 38 39 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 37 def created_version @created_version end |
#data_caption ⇒ String (readonly)
Returns data caption.
35 36 37 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 35 def @data_caption end |
#data_fields ⇒ DataFields (readonly)
Returns data fields.
57 58 59 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 57 def data_fields @data_fields end |
#indent ⇒ Integer (readonly)
Returns indent.
39 40 41 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 39 def indent @indent end |
#item_print_titles ⇒ True, False (readonly)
Returns should item print titles.
33 34 35 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 33 def item_print_titles @item_print_titles end |
#location ⇒ Location (readonly)
Returns location data.
47 48 49 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 47 def location @location end |
#multiple_field_filters ⇒ True, False (readonly)
Returns is there multiple fields filters.
45 46 47 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 45 def multiple_field_filters @multiple_field_filters end |
#name ⇒ String (readonly)
Returns name of table.
15 16 17 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 15 def name @name end |
#outline ⇒ True, False (readonly)
Returns outline.
41 42 43 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 41 def outline @outline end |
#outline_data ⇒ True, False (readonly)
Returns outline data.
43 44 45 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 43 def outline_data @outline_data end |
#page_fields ⇒ PageFields (readonly)
Returns page fields.
59 60 61 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 59 def page_fields @page_fields end |
#pivot_fields ⇒ PivotFields (readonly)
Returns pivot fields.
49 50 51 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 49 def pivot_fields @pivot_fields end |
#row_fields ⇒ RowFields (readonly)
Returns row fields.
61 62 63 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 61 def row_fields @row_fields end |
#row_items ⇒ ColumnRowItems (readonly)
Returns row items.
53 54 55 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 53 def row_items @row_items end |
#style_info ⇒ PivotTableStyleInfo (readonly)
Returns style info.
55 56 57 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 55 def style_info @style_info end |
#use_auto_formatting ⇒ True, False (readonly)
Returns should auto formatting be used.
31 32 33 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 31 def use_auto_formatting @use_auto_formatting end |
Instance Method Details
#parse(file) ⇒ PivotTableDefinition
Parse PivotTableDefinition object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb', line 68 def parse(file) doc = parse_xml("#{root_object.unpacked_folder}/#{file}") node = doc.xpath('//xmlns:pivotTableDefinition').first node.attributes.each do |key, value| case key when 'name' @name = value.value.to_s when 'cacheId' @cache_id = value.value.to_i when 'applyNumberFormats' @apply_number_formats = attribute_enabled?(value) when 'applyBorderFormats' @apply_border_formats = attribute_enabled?(value) when 'applyFontFormats' @apply_font_formats = attribute_enabled?(value) when 'applyPatternFormats' @apply_pattern_formats = attribute_enabled?(value) when 'applyAlignmentFormats' @apply_alignment_formats = attribute_enabled?(value) when 'applyWidthHeightFormats' @apply_width_height_formats = attribute_enabled?(value) when 'useAutoFormatting' @use_auto_formatting = attribute_enabled?(value) when 'itemPrintTitles' @item_print_titles = attribute_enabled?(value) when 'dataCaption' @data_caption = value.value.to_s when 'createdVersion' @created_version = value.value.to_i when 'indent' @indent = value.value.to_i when 'outline' @outline = attribute_enabled?(value) when 'outlineData' @outline_data = attribute_enabled?(value) when 'multipleFieldFilters' @multiple_field_filters = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'location' @location = Location.new(parent: self).parse(node_child) when 'pivotFields' @pivot_fields = PivotFields.new(parent: self).parse(node_child) when 'rowItems' @row_items = ColumnRowItems.new(parent: self).parse(node_child) when 'colItems' @column_items = ColumnRowItems.new(parent: self).parse(node_child) when 'pivotTableStyleInfo' @style_info = PivotTableStyleInfo.new(parent: self).parse(node_child) when 'dataFields' @data_fields = DataFields.new(parent: self).parse(node_child) when 'pageFields' @page_fields = PageFields.new(parent: self).parse(node_child) when 'rowFields' @row_fields = RowFields.new(parent: self).parse(node_child) when 'colFields' @column_fields = RowFields.new(parent: self).parse(node_child) end end self end |