You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by abstract <ab...@mail.ru> on 2011/05/18 13:19:26 UTC

BUG:(Excel 2007,.xls extension file,POI 3.7) Bug with comments of named range

Hi!
While experimenting with named ranges and its comments, i have found some
bugs. 

Configuration: Excel 2007, POI 3.7.

POI code snippet:
fisdoc=new FileInputStream(this.sourceAbsPath);
HSSFWorkbook wb_source = new HSSFWorkbook(fisdoc);
HSSFSheet sheet;
			
Name name=wb_source.createName();
name.setComment("HERE MIGHT BE YOURS COMMENT");
name.setRefersToFormula("Лист1!$A$1:$A$29");
name.setNameName("CREATED_BY_POI");
	 		
name=wb_source.getName("CREATED_FOR_POI");
this.result_text=name.getComment();
this.result_text+=name.getRefersToFormula();

FileOutputStream fisdoc_out= new FileOutputStream(this.sourceAbsPath);
wb_source.write(fisdoc_out);
fisdoc_out.close();
fisdoc.close();

1st: If I creating named range in Excel 2007 with creating  comments on
English, then sending file for processing- reading comments by POI works
fine.
2nd: Creating named range in Excel 2007 with creating comments with Cyrilic 
- appears Exception:
org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
Initialisation of record 0x894 left 6 bytes remaining still to be read.

org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:156)

org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:216)

org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:442)
	org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:263)
	org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:188)
	org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:305)
	org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:286)

3rd: Creating named range in POI, setting comments, trying to read comments
in Excel 2007 - comments is blank.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/BUG-Excel-2007-xls-extension-file-POI-3-7-Bug-with-comments-of-named-range-tp4406204p4406204.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org