After populating and saving a xlsx workbook, containing a Pivot, we get the below error when opening the saved file in excel.
Removed Part: /xl/pivotTables/pivotTable1.xml part with XML error. (PivotTable view) No attribute name may appear more than once in the same start tag or empty element tag. Line 12, column 215.
After then viewing the XML files, I found that the <pivotTableDefinition> tag in the xl\pivotTables\pivotTable1.xml file contains the "count" attributes twice.
I fixed this by preventing the "count" attribute to be added twice in the xpgPXML.pas => TXpgWriteXML.AddAttribute method
Code: Select all
procedure TXpgWriteXML.AddAttribute(const AName, AValue: AxUCString);
var
sAtt : string;
begin
sAtt:= FAttributes.pStart;
if (sAtt.Contains('count=') and (AName = 'count')) then
Exit;
//.
//.
//.