Bug 46736 - HSSFSheet autosizeColumn() doesn't process formula cells
Summary: HSSFSheet autosizeColumn() doesn't process formula cells
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.2-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-19 06:44 UTC by Maksym Symonov
Modified: 2009-02-19 09:30 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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