You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2013/02/20 01:49:23 UTC
[Bug 54588] New: CellFormat throws NPE for some other things that
occur in cell formats
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
Bug ID: 54588
Summary: CellFormat throws NPE for some other things that occur
in cell formats
Product: POI
Version: 3.7
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: dev@poi.apache.org
Reporter: trejkaz@trypticon.org
Classification: Unclassified
This is something we're seeing in customer data.
@Test
public void testCellFormat() {
CellFormat format = CellFormat.getInstance("_(*\"-\"??_);");
// not sure if this assertion is right, but we'll figure that out once
// the call completes without throwing an exception...
assertThat(format.apply(135.45).text, is(equalTo("135.45")));
}
I can't figure out what's specifically wrong with the format but I don't know
what this format means, either. If someone figures out what it is, perhaps the
bug summary could be made more specific.
Possibly related to Bug 53494, although in the case of that one, I can
reproducibly show that it's the locale code causing it. In this case, there is
no locale code, but there is other stuff which I don't know what it is.
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
sits <da...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #4 from sits <da...@gmail.com> ---
Hi Nick.. is this something you can fix? It would be great to see this
resolved.. thanks.
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #11 from sits <da...@gmail.com> ---
Hi Nick - just curious, were you able to reproduce this with my sample Excel
file that uses the "accounting type" for a cell value?
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #10 from sits <da...@gmail.com> ---
Created attachment 29979
--> https://issues.apache.org/bugzilla/attachment.cgi?id=29979&action=edit
Example Excel file
Now that I know it is a standard "accounting type", I can attach an example
Excel file. See attached.
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
sits <da...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |david.sitsky@gmail.com
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #8 from sits <da...@gmail.com> ---
Created attachment 29977
--> https://issues.apache.org/bugzilla/attachment.cgi?id=29977&action=edit
How some of these cells are rendered in Excel
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #7 from Trejkaz (pen name) <tr...@trypticon.org> ---
Reading the docs:
_(*"-"??_);
_( - a space, but the width of the (
* - repeat the next character to fill the column width
"-" - seems to be equivalent to -, unless double quotes escaped it somehow
?? - minimum of two significant zeroes
_) - a space, but the width of the )
;
Since it's *"-" I would expect that it pads with -... but it seems to be padded
with spaces instead, so I don't know... maybe the docs are just wrong. I'm not
an expert on Excel, I just know that this format throws an exception.
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #3 from Trejkaz (pen name) <tr...@trypticon.org> ---
Incidentally, the stack trace is on the same line as Bug 53494, so even though
the two look totally unrelated, it could be the same bug. In both cases there
are existing unit tests which reproduce the problem in isolation... so it
shouldn't be too hard to find it, right?
--
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
[Bug 54588] CellFormat throws NPE for standard "Accounting Type"
formatted cells
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
sits <da...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|CellFormat throws NPE for |CellFormat throws NPE for
|some other things that |standard "Accounting Type"
|occur in cell formats |formatted cells
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #9 from sits <da...@gmail.com> ---
Created attachment 29978
--> https://issues.apache.org/bugzilla/attachment.cgi?id=29978&action=edit
Number format of cell as shown in Excel 2010
FWIW.. right-clicking one of these cells and choosing "Format cells..." or
"Number format..." shows the item formatted as type "Accounting" in Excel 2010.
So perhaps it is a built-in format type?
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
Could you please let us know what the format string shows as in Excel? With
backslashes and quotes in your test, it's hard to be sure which bits have been
escaped by you, and which bits were escaped in Excel, so it's harder to work
out what it should be
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #2 from Trejkaz (pen name) <tr...@trypticon.org> ---
Nothing was escaped by Excel in the example provided there. I caught the format
string in the debugger while it was failing on the real file.
In the debug output it was just: _(*"-"??_);
Then I obviously had to add the backslashes to make it valid Java...
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #5 from Nick Burch <ap...@gagravarr.org> ---
I've been unable to get my copy of Excel to format a cell into anything
sensible using this format string, so I can't work out what POI should be doing
to start with
Are you able to supply an example of the raw value shown in Excel, and what it
formats to as a display value, when using this format string? Or event better,
maybe two or three (possibly involving a negative number)?
--
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
[Bug 54588] CellFormat throws NPE for some other things that occur
in cell formats
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54588
--- Comment #6 from Trejkaz (pen name) <tr...@trypticon.org> ---
I don't really have a copy of Excel to test this with, but...
In OpenOffice I can see it formatting them like normal numbers:
(positive example) 126,789.82
(negative example) -3,521.94
In Preview, I get something visually a bit odder:
(positive example) _-126,789.82_-
(negative example) - 3,521.94 (two spaces between the - and 3)
--
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