|Summary:||Applying style with big font does not update row height attributes|
|Product:||POI||Reporter:||Antti Koskimäki <antti.koskimaki>|
|Component:||HSSF||Assignee:||POI Developers List <dev>|
|Bug Depends on:||47658|
|Attachments:||source and excel to re-produce the bug|
Description Antti Koskimäki 2008-12-29 23:24:02 UTC
Created attachment 23062 [details] source and excel to re-produce the bug If I apply style with large font to cell, i.e. "insert large text", the resulting excel does have row tall enough to contain the text (font) but row.getHeight() still returns original height value. This happens even after reading the excel back (so it's consistent, nothing magic there either :=) But, after saving the resulted excel with Excel (2003) and reading THAT back to POI, the height-attributes are set to match the font, as expected. Tested with latest r729456. Source and excels to reproduce attached.
Comment 1 Antti Koskimäki 2009-01-07 01:38:39 UTC
> resulting excel does have row tall enough to contain the text (font) but > row.getHeight() still returns original height value. Another case related to here; if I have cell having "wrap text" option set, and row was therefore stretched, the getHeight() returns that stretched size, even after replacing the row contents with something that fits in "single height". I.e. the height value is not (re-)set here either.
Comment 2 Dominik Stadler 2020-03-08 08:37:26 UTC
As far as I see you are not adjusting the height of the row anywhere and Apache POI does not try to auto-size row-height based on fonts used in any cell. So by specifying the row-height via row.setHeightInPoints((short)30); before writing the file you should be able to get the expected behavior.