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 2021/04/16 03:09:12 UTC

[Bug 65245] New: In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

            Bug ID: 65245
           Summary: In Excel97-2003(xls), [¥300] is incorrectly output as
                    [$300]
           Product: POI
           Version: 5.0.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: wlyin@odc.ustcsoft.com
  Target Milestone: ---

Created attachment 37810
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37810&action=edit
sample code

In detail,
According to the suffix of Excel file, [apache tika] will automatically read
the contents of the Excel file.

callStacks:
    org\apache\tika\parser\microsoft\OfficeParser.#parse
    org\apache\tika\parser\microsoft\TikaHSSFListener#parse
    org\apache\tika\parser\microsoft\TikaHSSFListener#processFile
   
poi-5.0.0.jar!\org\apache\poi\hssf\eventusermodel\HSSFEventFactory.class#processEvents
   
poi-5.0.0.jar!\org\apache\poi\hssf\eventusermodel\HSSFEventFactory.class#genericProcessEvents
   
poi-5.0.0.jar!\org\apache\poi\hssf\eventusermodel\HSSFRequest.class#processRecord
   
poi-5.0.0.jar!\org\apache\poi\hssf\eventusermodel\FormatTrackingHSSFListener.classFormatTrackingHSSFListener#processRecord

In Excel97-2003(xls),
When [Format Cells > Number > Currency > Negative numbers]  is set to [¥-1,234]
or [(RED)¥-1,234],
there will be a problem that [¥300] is read incorrectly as [$300].

The reason is that the Formatindex value of[¥- 1,234] and [(RED)¥-1,234] are
[5] and [6], 
but the Formatindex values below 50 belong to [Custom] types.
The Formatindex and FormatString of [Custom] are as follows:
    5-->    "\"$\"#,##0_);(\"$\"#,##0)",
    6-->    "\"$\"#,##0_);[Red](\"$\"#,##0)",

Please refer to the attachment for sample code.

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

ragebear <bi...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #37810|0                           |1
        is obsolete|                            |
  Attachment #37838|0                           |1
        is obsolete|                            |
  Attachment #37839|0                           |1
        is obsolete|                            |

--- Comment #5 from ragebear <bi...@hotmail.com> ---
Created attachment 39790
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39790&action=edit
the attachment is the target PDF to be parse by Tika

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Can you try setting the user-local via LocalUtil.setUserLocale() to see if the
local set locale affects this?

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

--- Comment #7 from ragebear <bi...@hotmail.com> ---
Created attachment 39792
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39792&action=edit
the EXPECTED result (if correct)

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

--- Comment #6 from ragebear <bi...@hotmail.com> ---
Created attachment 39791
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39791&action=edit
the result parsed by Tika and Tika Server 2.9.2 and 3.0beta

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #8 from Nick Burch <ap...@gagravarr.org> ---
If you open the Excel file on a computer where the locale is set to US-English,
does it show a $ or a ¥ ?

Excel has ways of formatting numbers and dates so that they change how they
look on different locales when opened, along with ways of formatting that are
consistent no matter where they are opened. It look like your file might be the
former

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

--- Comment #3 from Yin WeiLi <wl...@odc.ustcsoft.com> ---
Created attachment 37839
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37839&action=edit
test results

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

--- Comment #2 from Yin WeiLi <wl...@odc.ustcsoft.com> ---
Created attachment 37838
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37838&action=edit
sample code2

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

--- Comment #4 from Yin WeiLi <wl...@odc.ustcsoft.com> ---
Thank you for your proposal.

I tried the method you mentioned, but it still doesn't work.

Please refer to the attachment [sample2] and [poi] for sample code.

-- 
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 65245] In Excel97-2003(xls), [¥300] is incorrectly output as [$300]

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65245

Dominik Stadler <do...@gmx.at> 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