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 50211] autoSizeColumn calculates wrong column size of formula cells
Date Tue, 09 Nov 2010 15:17:29 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50211

Yegor Kozlov <yegor@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Yegor Kozlov <yegor@dinom.ru> 2010-11-09 10:17:23 EST ---
Should be fixed in r1033005. 

Sheet.autoSizeColumn does not evaluate formula cells, instead it sizes the
formula cells based on their cached formula results. If a formula was never
evaluated (like in your case), the cached result is undefined the result of
autoSizeColumn can be 'off'. This means that it is a good idea to evaluate the
entire workbook before auto-sizing. The simplest way to evaluate all cells is
as follows:

   HSSFFormulaEvaluator.evaluateAllFormulaCells(workbbok);

Just insert this line before calling Sheet.autoSizeColumn.

Yegor

-- 
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