You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Phil Varner <ph...@gmail.com> on 2010/03/06 16:09:26 UTC

Re: EventBasedExcelExtractor issue with cell format strings

I added my patch to the bug report, it's totally correct but better
than throwing an exception and aborting processing of the file.

--Phil

On Wed, Jan 6, 2010 at 9:43 AM, Phil Varner <ph...@gmail.com> wrote:
> On Wed, Jan 6, 2010 at 2:35 AM, Nick Burch <ni...@alfresco.com> wrote:
>> On Tue, 5 Jan 2010, Phil Varner wrote:
>>>
>>> The EBEE tries to format decimal values before returning them using
>>> the method formatNumberDateCell.  I have some xls (unfortunately I
>>> can't share) that throw an exception from the DecimalFormat
>>> constructor:
>>> java.lang.IllegalArgumentException: Unquoted special character ';' in
>>> pattern "_(*#,##0_);_(*(#,##0);_(* "-"_);_(@_)"
>>
>> Any chance you could create a new simple workbook, and copy just the number
>> formatting and that number over? If you upload that to bugzilla, we can then
>> take a look
>>
>> OOI, does the usermodel cope ok with your format?
>
> UserModel copes, but because no formatting is applied. Relevant code
> in ExcelExtractor:
>
> case HSSFCell.CELL_TYPE_NUMERIC:
>  // Note - we don't apply any formatting!
>  text.append(cell.getNumericCellValue());
>  break;
>
> However, a date formatted cell (string cell type) with
> "hh:mm;hh:mm;hh:mm" fails in both.
>
> I believe this means conditional cell formatting never works (either
> not being applied or throwing exception), only static cell formatting.
>  I'm not sure what the above format of the 3- or 4-valued conditional
> is, though.
>
> I'll file a bug for this. Attached is a doc that exhibits the issue
> and a java class that reproduces.
>
> --Phil
>



-- 

Machines might be interesting, but people are fascinating. -- K.P.

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