poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45717] On sheet creation from scratch at HSSFRow.createCell(): IllegalStateException: Cannot create value records before row records exist
Date Mon, 01 Sep 2008 17:14:09 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45717





--- Comment #4 from Josh Micich <josh@gildedtree.com>  2008-09-01 10:14:08 PST ---
To make the unit test I reduced your example down to these lines of code:

HSSFSheet sheet = workbook.createSheet("Vorschauliste");
HSSFRow row = sheet.createRow(0);            // B
sheet.setMargin(HSSFSheet.LeftMargin, 0.3);  // A 
row.createCell((short) 0);                   // C

To cause the IllegalStateException, the critical factor is to execute the three
labeled lines in the above order.  The other two possible orderings (A, B, C)
and (B, C, A) work OK.  For me, setting the sheet margins before creating rows
makes a little more sense. To be clear:

HSSFSheet sheet = workbook.createSheet("Vorschauliste");
sheet.setMargin(HSSFSheet.LeftMargin, 0.3);  // A 
HSSFRow row = sheet.createRow(0);            // B
row.createCell((short) 0);                   // C

Either re-ordering would be a 'code around' for the specific example provided. 
However there is no guarantee that this would be the only thing you need to do
to avoid the problems fixed in r683758 and r683871.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message