0

spreadsheet exception :XmlValueDisconnectedException

asked 2012-10-12 05:24:24 +0800

bthevenet gravatar image bthevenet
54

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.

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2012-10-24 07:28:10 +0800

samchuang gravatar image samchuang
4084 4

Hi, can you provide a reproduce-able excel, and user's input,

also, does this exception only occur when auto save that you implement, or does it also occur when user click some save button ?

link publish delete flag offensive edit

answered 2012-10-25 02:17:39 +0800

bthevenet gravatar image bthevenet
54

updated 2012-10-25 02:20:13 +0800

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.

link publish delete flag offensive edit

answered 2012-10-25 10:18:19 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-10-25 10:20:32 +0800

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

link publish delete flag offensive edit

answered 2012-10-29 23:59:46 +0800

bthevenet gravatar image bthevenet
54

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

link publish delete flag offensive edit

answered 2012-10-30 01:49:45 +0800

samchuang gravatar image samchuang
4084 4

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

link publish delete flag offensive edit

answered 2012-10-30 05:14:08 +0800

bthevenet gravatar image bthevenet
54

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

link publish delete flag offensive edit

answered 2012-10-30 09:33:25 +0800

samchuang gravatar image samchuang
4084 4

I can reproduce it following your steps

please post this bug at here

link publish delete flag offensive edit

answered 2012-11-22 08:49:42 +0800

samchuang gravatar image samchuang
4084 4

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);
		}
.......

link publish delete flag offensive edit

answered 2012-12-14 02:18:11 +0800

samchuang gravatar image samchuang
4084 4

Hi,

the issue has been fixed, you can download the FL version to test it

zssee-bin-eval-2.6.0-FL-2012-12-12.zip from
http://www.zkoss.org/download/freshly/zss

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-10-12 05:24:24 +0800

Seen: 178 times

Last updated: Dec 14 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More