Bug 46736

Summary: HSSFSheet autosizeColumn() doesn't process formula cells
Product: POI Reporter: Maksym Symonov <Maksym_Symonov>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.2-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Maksym Symonov 2009-02-19 06:44:30 UTC
HSSFSheet autosizeColumn() doesn't process formula cells. It works just with string, number and boolean cells. It can use HSSFFormulaEvaluator to get cell value and process it too
Comment 1 Yegor Kozlov 2009-02-19 08:15:13 UTC
HSSFSheet.autosizeColumn() operates on static, i.e. non-formula cell values. It wasn't written with formula evaluation in mind and I don't think we should change it that way. 

However, your post suggests a natural improvement to use the cached formula result when autosizing columns. If the cached value is wrong or out of date, you can use HSSFFormulaEvaluator to update it.

Yegor
Comment 2 Yegor Kozlov 2009-02-19 09:30:15 UTC
Fixed in r745937 both for HSSF and XSSF.

Regards,
Yegor