You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by leena808 <le...@yahoo.com> on 2014/06/18 19:49:30 UTC

How to use SXSSFWorkbook to write to existing template with cell formatting applied

I am using poi-3.10-FINAL-20140208.jar and trying to do the following:

//Template.xlsx has no data but some cells are formatted to have Date,
decimal format, certain fonts, etc
Workbook workbook = new SXSSFWorkbook(new XSSFWorkbook(new
FileInputStream("Template.xlsx"))); 
Sheet sheet = workbook.getSheetAt(0); 
Row row = sheet.createRow(0); 

The above line gives an error - Attempting to write a row[0] in the range
[0,1] that is already written to disk. I understand that this is because of
the styles stored in the cells and causes 
_sh.getPhysicalNumberOfRows() to return 1. 

I wanted to ask how to write to a template with styles using SXSSF without
running into errors.

Thank you,
Leena




--
View this message in context: http://apache-poi.1045710.n5.nabble.com/How-to-use-SXSSFWorkbook-to-write-to-existing-template-with-cell-formatting-applied-tp5715855.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