diff options
| author | Randy Morgan <[email protected]> | 2013-09-12 22:13:09 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2013-09-13 00:08:39 +0900 |
| commit | b5a6263ec3ec0a729c9b2bec86c22d1ead33eb65 (patch) | |
| tree | 4787d30e49eb8425885a37af9008aafa69fb9419 /lib | |
| parent | 923e7b7ff9157bdfe95584b8d311e2f6099ab71d (diff) | |
| download | caxlsx-b5a6263ec3ec0a729c9b2bec86c22d1ead33eb65.tar.gz caxlsx-b5a6263ec3ec0a729c9b2bec86c22d1ead33eb65.zip | |
repair pivot table data ref populate and bring coverage back up to 100%
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/pivot_table.rb | 6 |
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 |
