summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/pivot_table.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/axlsx/workbook/worksheet/pivot_table.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/pivot_table.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb
index e97b8119..27065e4b 100644
--- a/lib/axlsx/workbook/worksheet/pivot_table.rb
+++ b/lib/axlsx/workbook/worksheet/pivot_table.rb
@@ -189,10 +189,10 @@ module Axlsx
def to_xml_string(str = +'')
str << '<?xml version="1.0" encoding="UTF-8"?>'
- str << (+'<pivotTableDefinition xmlns="' << XML_NS << '" name="' << name << '" cacheId="' << cache_definition.cache_id.to_s << '"' << (data.size <= 1 ? ' dataOnRows="1"' : '') << ' applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Data" showMultipleLabel="0" showMemberPropertyTips="0" useAutoFormatting="1" indent="0" compact="0" compactData="0" gridDropZones="1" multipleFieldFilters="0">')
+ str << '<pivotTableDefinition xmlns="' << XML_NS << '" name="' << name << '" cacheId="' << cache_definition.cache_id.to_s << '"' << (data.size <= 1 ? ' dataOnRows="1"' : '') << ' applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Data" showMultipleLabel="0" showMemberPropertyTips="0" useAutoFormatting="1" indent="0" compact="0" compactData="0" gridDropZones="1" multipleFieldFilters="0">'
- str << (+'<location firstDataCol="1" firstDataRow="1" firstHeaderRow="1" ref="' << ref << '"/>')
- str << (+'<pivotFields count="' << header_cells_count.to_s << '">')
+ str << '<location firstDataCol="1" firstDataRow="1" firstHeaderRow="1" ref="' << ref << '"/>'
+ str << '<pivotFields count="' << header_cells_count.to_s << '">'
header_cell_values.each do |cell_value|
subtotal = !no_subtotals_on_headers.include?(cell_value)
@@ -205,12 +205,12 @@ module Axlsx
str << '<rowFields count="1"><field x="-2"/></rowFields>'
str << '<rowItems count="2"><i><x/></i> <i i="1"><x v="1"/></i></rowItems>'
else
- str << (+'<rowFields count="' << rows.size.to_s << '">')
+ str << '<rowFields count="' << rows.size.to_s << '">'
rows.each do |row_value|
- str << (+'<field x="' << header_index_of(row_value).to_s << '"/>')
+ str << '<field x="' << header_index_of(row_value).to_s << '"/>'
end
str << '</rowFields>'
- str << (+'<rowItems count="' << rows.size.to_s << '">')
+ str << '<rowItems count="' << rows.size.to_s << '">'
rows.size.times do |i|
str << '<i/>'
end
@@ -229,16 +229,16 @@ module Axlsx
str << '<colItems count="1"><i/></colItems>'
end
else
- str << (+'<colFields count="' << columns.size.to_s << '">')
+ str << '<colFields count="' << columns.size.to_s << '">'
columns.each do |column_value|
- str << (+'<field x="' << header_index_of(column_value).to_s << '"/>')
+ str << '<field x="' << header_index_of(column_value).to_s << '"/>'
end
str << '</colFields>'
end
unless pages.empty?
- str << (+'<pageFields count="' << pages.size.to_s << '">')
+ str << '<pageFields count="' << pages.size.to_s << '">'
pages.each do |page_value|
- str << (+'<pageField fld="' << header_index_of(page_value).to_s << '"/>')
+ str << '<pageField fld="' << header_index_of(page_value).to_s << '"/>'
end
str << '</pageFields>'
end