Bug 54907 - Unreadable content error when reading .xlsx with external links containing U+3000('IDEOGRAPHIC SPACE') character.
Summary: Unreadable content error when reading .xlsx with external links containing U+...
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 06:53 UTC by Lee
Modified: 2013-05-25 14:52 UTC (History)
1 user (show)



Attachments
The attached excel file for these issue has a external links (11.53 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2013-04-30 06:53 UTC, Lee
Details
The file which produces Unreadable content error (9.04 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2013-04-30 06:55 UTC, Lee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee 2013-04-30 06:53:33 UTC
Created attachment 30241 [details]
The attached excel file for these issue has a external links

Just as simple test, I used POI to read the xlsx file and then immediately write it out without any modification.  
After writing with POI the xlsx file is unreadable by MS Excel 2010: 
Excel found unreadable content in 'xxx.xlsx'. Do you want to recover the contents of this workbook?

This is most likely happening because that the external links in workbook contain U+3000 "IDEOGRAPHIC SPACE" character (commonly called a 'full-width space').

※ how to create external links in excel
 Define a name by using the New Name dialog box
 1.On the Formulas tab, in the Defined Names group, click Define Name.
 2.In the New Name dialog box, in the Name box, type the name.
 3.To specify the scope of the name, select Workbook.
 4.In the Refers to box, type the cell reference of External Excel file.
   ex)='D:\[1 test.xlsx]Sheet1'!$A$2

This is the code I used: 

/////////////////////////////////
import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

public class ExternalLinkTest {

	public static void main(String[] args) {

		Workbook workBook = null;
		try {
			workBook = WorkbookFactory
			    .create(new FileInputStream("externalLink.xlsx"));

			FileOutputStream fileOut;
			fileOut = new FileOutputStream("output_externalLink.xlsx");
			workBook.write(fileOut);
			fileOut.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
/////////////////////////////////
Comment 1 Lee 2013-04-30 06:55:11 UTC
Created attachment 30242 [details]
The file which produces Unreadable content error
Comment 2 Dominik Stadler 2013-05-25 14:52:57 UTC
POI itself can read the file back in, however in the .xlsx file that is generated by POI, the file under /xl/externalLinks/_rels/externalLink1.xml.rels is missing completely in the resulting file.