Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-313

Importer fails with internal external reference

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.4.0
    • 5.3.0
    • None
    • None

      Steps to Reproduce

      Run keikai with attached spreadsheet

      Current Result

      HTTP ERROR 500 io.keikai.importer.ImportException: Fail to import cell B1 in sheet Sheet1 from book 2-internalexternal.xlsx

      URI: /tutorial/editor.zul
      STATUS: 500
      MESSAGE: io.keikai.importer.ImportException: Fail to import cell B1 in sheet Sheet1 from book 2-internalexternal.xlsx
      SERVLET: DHtmlLayoutServlet
      CAUSED BY: io.keikai.importer.ImportException: Fail to import cell B1 in sheet Sheet1 from book 2-internalexternal.xlsx
      CAUSED BY: io.keikai.model.InvalidFormulaException: Expect a legal Table

      Caused by:

      io.keikai.importer.ImportException: Fail to import cell B1 in sheet Sheet1 from book 2-internalexternal.xlsx at io.keikai.importer.XlsxImporter.imports(XlsxImporter.java:319) at io.keikai.range.impl.imexp.ExcelImportAdapter.imports(ExcelImportAdapter.java:48) at io.keikai.range.impl.imexp.AbstractImporter.imports(AbstractImporter.java:57) at io.keikai.ui.Spreadsheet.getSBook(Spreadsheet.java:649) at io.keikai.ui.Spreadsheet.getSelectedSSheet(Spreadsheet.java:828) at io.keikai.ui.Spreadsheet.doInvalidate(Spreadsheet.java:2546) at io.keikai.ui.Spreadsheet.invalidate(Spreadsheet.java:2403) at io.keikai.ui.Spreadsheet.setSrc(Spreadsheet.java:877)

      Expected Result

      works in excel

      Debug Information

      Excel formula usually threats formulas such as =[name]columnreference as table references.

      However, if a file does an external reference to itself such as:

      (in file named book1.xlsx, with a named ranged named foo)

      ='book1.xlsx'!foo

      This formula is stored in the internal workbook data as [0]!foo.

      (for some reason, Excel will store external files as numbered [intId] in the xml data and will link to external files. if the external file is different from current, the link index starts at 1 (which is handled)

      but internal external references will always use index 0 which fails parsing.

      Workaround

      Do not make reference to the file in the file.

      (Currently no known applicable use for this pattern which cannot be done by not including the file name)

            CharlieHsieh CharlieHsieh
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: