Exception when writing to the xlsx document several times using apache poi 3.7

后端 未结 7 1736
夕颜
夕颜 2020-11-29 08:44

I am getting the following exception while trying to write an .xlsx file using Apache POI: org.apache.xmlbeans.impl.values.XmlValueDisconnectedException

7条回答
  •  难免孤独
    2020-11-29 09:00

    This occurs only when we try to write more than once to the same file that too for a .xlsx file. I came accross the same issue and got it resolved by..

    1. Previously i was writing twice
    2. Now removed the first write call
    3. Passed the same workbook instance to the method and set values to the new cell
    4. finally did some more changes to the workbook by writing few more columns and cells
    5. Then wrote using the file output stream.

    It was working

提交回复
热议问题