Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1120

Fails to export named styles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.8.2
    • 3.8.1
    • None
    • Security Level: Jimmy
    • None
    • Sprint 1

      steps to reproduce

      1. load the attached file
      2. export it as an Excel file

      Actual result

      java.lang.ArrayIndexOutOfBoundsException: -11353
      at java.util.ArrayList.elementData(ArrayList.java:418)
      at java.util.ArrayList.get(ArrayList.java:431)
      at org.zkoss.poi.xssf.model.StylesTable.getCellStyleXfAt(StylesTable.java:340)
      at org.zkoss.poi.xssf.usermodel.XSSFCellStyle.<init>(XSSFCellStyle.java:83)
      at org.zkoss.poi.xssf.usermodel.XSSFNamedStyle.<init>(XSSFNamedStyle.java:54)
      at org.zkoss.poi.xssf.usermodel.XSSFWorkbook.createNamedStyle(XSSFWorkbook.java:1954)
      at org.zkoss.zss.range.impl.imexp.AbstractExcelExporter.toPOINamedStyle(AbstractExcelExporter.java:497)
      at org.zkoss.zss.range.impl.imexp.AbstractExcelExporter.export(AbstractExcelExporter.java:116)
      at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49)
      at com.azquo.spreadsheet.controller.ZKSpreadsheetCommandController$1.process(ZKSpreadsheetCommandController.java:92)
      at org.zkoss.zssex.ui.UpdateBridge.process(UpdateBridge.java:60)

      Debug information

      related code:

      public class XSSFNamedStyle implements NamedStyle {
      
      
          private int _cellStyleXfId;
      
          private
      	@Override
      	public short getIndex() {
      		return (short) _cellStyleXfId;
      	}
      

      The index is converted to a short and becomes a negative number, but it should be a 0-based integer.

      workaround

      • Do not import named styles. Then exported file content is also correct.

            henrichen henrichen
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: