-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi every body,
I integreted zk spreadsheet in our project and I added listener, which save if user made change.
I have use this code :
Exporter c = Exporters.getExporter("excel");
c.export(wb, out);
and I have tried that
wb.write(out);
in both case, as soon as,I make a change, I get this exception :
org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
at org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1213)
at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellImpl.getR(Unknown Source)
at org.zkoss.poi.xssf.usermodel.XSSFRow.onDocumentWrite(XSSFRow.java:460)
at org.zkoss.poi.xssf.usermodel.XSSFSheet.write(XSSFSheet.java:2743)
at org.zkoss.poi.xssf.usermodel.XSSFSheet.commit(XSSFSheet.java:2712)
at org.zkoss.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:313)
at org.zkoss.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:317)
at org.zkoss.poi.POIXMLDocument.write(POIXMLDocument.java:173)
at org.zkoss.zss.app.file.FileHelper.saveSpreadsheet(FileHelper.java:194)
and I can't change columns width or add columns.
thank you in advance.
hi,
this bug occur when user click at save button or export to excel button or auto save that I implemented.
this bug don't occur systematically.
generaly it occur when you alternate modify and save or export repeatedly on the same file without refresh.
hi, I cannot reproduce this issue using zss app demo application with ZSS-demo_sample.xlsx excel file. Can you list all the steps that can trigger this issue ? and the excel file
Hi,
to reproduce in the demo file, you switch between edit and export to Excel
to make change, add a columns, resize a columns, change a cells styles ...etc.
especially stretch a cells on each other, to copy values
best regards
hi, I cannot reproduce it using the following steps with zssapp demo application
1. insert one column at "F"
2. resize the column "F"
3. change column G font color to red
4. stretch G13 to F13 (copy the G13 to F13)
5. export the excel by click save button
6. reload page
hi,
you're nearly
do this and don't reload page.
1. insert one column at "F"
2. resize the column "F"
3. change column G font color to red
4. export the excel by click save button
5. stretch G13 to F13 (copy the G13 to F13)
I try it on demo page http://zssdemo.zkoss.org/zssdemo/index.zul
and in each time I have the bug
best regards
hi
after further research, this bug seems cause by poi or xmlbeans, reefer to
https://issues.apache.org/bugzilla/show_bug.cgi?id=49940
http://stackoverflow.com/questions/8253653/exception-when-writing-to-the-xlsx-document-several-times-using-apache-poi-3-7
there's a workaround, after you save file, you need to load book from the file (the one just saved)
for example
public void save() { File file = FileHelper.saveSpreadsheet(spreadsheet); String originalSrc = spreadsheet.getSrc(); spreadsheet.setSrc(null); try { spreadsheet.setBook(new ExcelImporter().importsFromURL(file.toURI().toURL())); spreadsheet.setSrcName(originalSrc); } catch (MalformedURLException e) { throw UiException.Aide.wrap(e); } .......
Asked: 2012-10-12 05:24:24 +0800
Seen: 178 times
Last updated: Dec 14 '12