ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Downloading PF to Excel format using Java program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Downloading PF to Excel format using Java program

    Hi, I'm downloading a Physical file and converting it to an excel format using a java program.The file i'm downloading contains Thailand Characters. When I download the file to Excel, the fields that should contains Thai characters were garbled/garbage... I have tried setting the Host code page of the client access to 838 (thai) and set the regional settings of windows to Thai...but still the fields contains distorted or not readable.. do I need to setup anythink to browse the excel in the correct format...

    The java program uses the following codes in setting up the font:


    // set chars
    charsFont.setFontHeightInPoints((short) 10);
    charsFont.setColor(black.getIndex());
    charsFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL );
    chars.setFont(charsFont);

    // this is the portion when reading the PF
    c.setEncoding(HSSFCell.ENCODING_UTF_16);
    c.setCellStyle(chars);

  • #2
    Re: Downloading PF to Excel format using Java program

    The little java code that you posted looks correct to me. Depending on which version of poi you are using you might not have to force the encoding to UTF_16.
    You might want to post this code on a poi specfic forum and check your excel language packs.
    Predictions are usually difficult, especially about the future. ~Yogi Berra

    Vertical Software Systems
    VSS.biz

    Comment

    Working...
    X