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 30319] New: - Unicode in usermodel DataFormat (+ FIX)
Date Mon, 26 Jul 2004 09:58:31 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30319>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30319

Unicode in usermodel DataFormat (+ FIX)

           Summary: Unicode in usermodel DataFormat (+ FIX)
           Product: POI
           Version: 2.5
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: ejb@klomp.org


I couldn't get the euro symbol to work in a DataFormat.
The formatting String that Excel uses for the "Financial, EU 123" format is:
"_([$\u20ac-2]\\ * #,##0.00_);_([$\u20ac-2]\\ * \\(#,##0.00\\);_([$\u20ac-2]\\ *
\"-\"??_);_(@_)"

I could read this with the HSSF usermodel classes from a workbook created by
Excel, but when trying to create a workbook the character would change into a
logical-not symbol.

After some searching in the hssf.record package I found the class FormatRecord
which has a method setUnicodeFlag, but this method isn't called when the
usermodel creates a DataFormat.

I fixed it by changing the class org.apache.poi.hssf.model.Workbook (not
HSSFWorkbook)
In its method "public short createFormat( String format )" I added the line:
rec.setUnicodeFlag( true );

After this change, euro symbols work fine in a DataFormat.

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


Mime
View raw message