From c8eb5fe13bfca2dcac17848dd15dc04f4f0dcf9b Mon Sep 17 00:00:00 2001 From: Weston Ganger Date: Thu, 13 Jan 2022 08:06:07 -0800 Subject: Fix invalid xml when pivot table created with more than one column in data field --- lib/axlsx/workbook/worksheet/pivot_table.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb index d8c630ec..bc500a8a 100644 --- a/lib/axlsx/workbook/worksheet/pivot_table.rb +++ b/lib/axlsx/workbook/worksheet/pivot_table.rb @@ -173,7 +173,9 @@ module Axlsx # @return [String] def to_xml_string(str = '') str << '' - str << ('') + + str << ('') + str << ('') str << ('') header_cell_values.each do |cell_value| @@ -195,7 +197,7 @@ module Axlsx end str << '' end - if columns.empty? + if columns.empty? && data.size <= 1 str << '' else str << ('') -- cgit v1.2.3