https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

            Bug ID: 61281
           Summary: XML export of xlsx results in
                    IndexOutOfBoundsException
           Product: POI
           Version: 3.14-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

When attempting to Export the XML of attached xlsx, there occurs following
exception:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.rangeCheck(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:203)
        at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:109)

The reason is, that one column of the table isn't mapped. When I do the export
from Excel, it works. There is a different handling between Excel and Apache
POI.
The code for exporting the XML is as following:

 XSSFWorkbook wb = /*given from previous code execution*/;
       for (XSSFMap map : wb.getCustomXMLMappings()) {
           XSSFExportToXml exporter = new XSSFExportToXml(map);

           ByteArrayOutputStream os = new ByteArrayOutputStream();
           exporter.exportToXML(os, true);
       }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to