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 2016/09/19 07:27:10 UTC

[Bug 60147] New: Unable to export string “IBM_x3550_M2” correctly

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

            Bug ID: 60147
           Summary: Unable to export string “IBM_x3550_M2” correctly
           Product: POI
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: 346164994@qq.com

Created attachment 34272
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34272&action=edit
export result

Hello !
I want to export to excel 2007 use XSSF, but i found some string can't export
correctly such as "IBM_x3550_M2", this string will be export to "IBM㕐M2".

Then i found the problem is "_x3550_", when the string's format like
"_xNUMBER_"  and the NUMBER is a Unicode code , then it will be export to
"_xChinese character_".

Is this a bug of XSSF ?
Or there are some other ways to resolve it?

PS:Use HSSF to export Excel 2003 is correctly!

-- 
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 60147] Unable to export string “IBM_x3550_M2” correctly

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #6 from Dominik Stadler <do...@gmx.at> ---
We had a few discussions around this already, see
https://bz.apache.org/bugzilla/buglist.cgi?f0=OP&f1=OP&f3=CP&f4=CP&j2=OR&list_id=151221&product=POI&query_format=advanced&short_desc=_x&short_desc_type=allwordssubstr
for some matches. 

Specifically bug 57008 discussed this. Short answer: this is how Excel encodes
special characters and the POI API currently does not interfere with these
escape-sequences currently, so to solve this you should escape strings like
these as described in bug 57008, specifically "This seems to be an Excel
"feature" and if you prepend this string with "_0x005F" the string stays at it
is."

*** This bug has been marked as a duplicate of bug 57008 ***

-- 
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 60147] Unable to export string “IBM_x3550_M2” correctly

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

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Javen O'Neal <on...@apache.org> ---
Could you include a code sample to reproduce 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 60147] Unable to export string “IBM_x3550_M2” correctly

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

--- Comment #3 from onlyarticle <34...@qq.com> ---
Created attachment 34273
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34273&action=edit
code sample

-- 
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 60147] Unable to export string “IBM_x3550_M2” correctly

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

Javen O'Neal <on...@apache.org> changed:

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

--- Comment #4 from Javen O'Neal <on...@apache.org> ---
I was hoping for a code sample that is less than 20 lines. I do not understand
what function is causing the problem from comment 0.

What code is called when you "export to Excel"? Where is the Unicode string
set? Is this on an existing document or a new document? A concise code sample
should be able to answer 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 60147] Unable to export string “IBM_x3550_M2” correctly

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

--- Comment #2 from onlyarticle <34...@qq.com> ---
(In reply to Javen O'Neal from comment #1)
> Could you include a code sample to reproduce this?

code sample is normal ,you can try it by yourself!

By the way,jxls has same problem when i use to export Excel 2007,because jxls
is base poi!

-- 
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 60147] Unable to export string “IBM_x3550_M2” correctly

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

--- Comment #5 from onlyarticle <34...@qq.com> ---
(In reply to Javen O'Neal from comment #4)

code sample like this :

XSSFRow row = sheet.createRow(rowNum);
XSSFCell cell = row.createCell(i);
cell.setCellStyle(style);
cell.setCellValue(textValue);

OR 

XSSFRichTextString richString = new XSSFRichTextString(textValue);
richString.applyFont(font);
cell.setCellValue(richString);

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