I am trying to create a pivot table in my workbook, but when I open the result .xlsx file in Microsoft Excel I get the following error message:
Excel could not open accounts (3).xlsx because some content is unreadable. Do you want to open and repair this workbook?
I click the “Open and Repair” button and get a popup that says:
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px ‘Helvetica Neue’}
Excel repaired or removed unreadable content from this workbook.
An .xml log file is created with the following content:
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #ba2da2} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures} span.s2 {font-variant-ligatures: no-common-ligatures; color: #d12f1b} span.s3 {font-variant-ligatures: no-common-ligatures; color: #ba2da2} span.s4 {font-variant-ligatures: no-common-ligatures; color: #957e35} span.s5 {font-variant-ligatures: no-common-ligatures; color: #1337ff}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>Repair Result to accounts (3)3.xml
Errors were detected in file ‘/path/to/accounts (3).xlsx’
Removed Feature: PivotTable report from /xl/pivotCache/pivotCacheDefinition1.xml (PivotTable cache)
Removed Feature: PivotTable report from /xl/pivotTables/pivotTable1.xml (PivotTable view)
Removed Records: Workbook properties from /xl/workbook.xml (Workbook)
Here is an example of my pivot table creation code:
int sheetIndex = workbook.getWorksheets().add();
Worksheet sheet = workbook.getWorksheets().get(sheetIndex);
sheet.setName(“Financial Class”);
PivotTableCollection pivotTables = sheet.getPivotTables();
int index = pivotTables.add("=Data!A1:AE462", “A1”, “Financial Class”);
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #3933ff} span.s1 {color: #931a68} span.s2 {color: #7e504f} span.s3 {color: #3933ff} span.s4 {color: #000000} span.s5 {text-decoration: underline ; color: #7e504f} span.s6 {text-decoration: underline ; color: #000000} span.s7 {text-decoration: underline}