summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/pivot_table.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb
index 0de22f8f..d27e08ad 100644
--- a/lib/axlsx/workbook/worksheet/pivot_table.rb
+++ b/lib/axlsx/workbook/worksheet/pivot_table.rb
@@ -253,7 +253,7 @@ module Axlsx
'<pivotField axis="axisCol" compact="0" outline="0" subtotalTop="0" showAll="0" includeNewItemsInFilter="1">' <<
'<items count="1"><item t="default"/></items>' <<
'</pivotField>'
- elsif data.include? cell_ref
+ elsif data_refs.include? cell_ref
'<pivotField dataField="1" compact="0" outline="0" subtotalTop="0" showAll="0" includeNewItemsInFilter="1">' <<
'</pivotField>'
else
@@ -261,7 +261,9 @@ module Axlsx
'</pivotField>'
end
end
-
+ def data_refs
+ data.map { |hash| hash[:ref] }
+ end
def header_range
range.gsub(/^(\w+?)(\d+)\:(\w+?)\d+$/, '\1\2:\3\2')
end