Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:44:38+00:00 2026-06-17T23:44:38+00:00

I am using apache poi-3.9 to create Excel (xls) worksheets with some measurement data,

  • 0

I am using apache poi-3.9 to create Excel (xls) worksheets with some measurement data, which are supposed to be displayed with units within the cell. Units are mbar, mm/sec, and (°) degrees. For mbar and mm/sec everything works perfectly fine, but with degrees formatting gets lost. Microsoft Excel complains with the following error message: “File error. Some number formats may have been lost.”
Here is my code:

final HSSFWorkbook hssfWorkbook = new HSSFWorkbook();

final HSSFCellStyle cellStyleMbar = hssfWorkbook.createCellStyle();
final HSSFCellStyle cellStyleDegree = hssfWorkbook.createCellStyle();

cellStyleMbar.setDataFormat(dataFormat.getFormat(“0 \”mbar\””));
cellStyleDegree.setDataFormat(dataFormat.getFormat(“0.0 \”°C”));

Thank you for your ideas!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:44:40+00:00Added an answer on June 17, 2026 at 11:44 pm

    The problem is probably that you don’t close the quoted text in the format template.

    Replace

    dataFormat.getFormat("0.0 \"°C")

    with

    dataFormat.getFormat("0.0 \"°C\"")

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Apache POI API to generate excel spreadsheet to output some data.
I'm able to create an excel file using apache poi. however, i want users
I'm using Apache POI 3.6, I want to read an excel file which has
I'm trying to create some xlsx files using the Apache POI library for Java
I am using Apache POI to store data in excel sheet. I can store
When trying to convert excel file to Html using org.apache.poi.ss.examples.html.ToHtml.create(...), the call crashes with
Using Apache POI HSSF, we can create xls file like this private void write(HSSFWorkbook
I am using apache poi 3.5 for extracting data from the excel sheet.i having
I've been using Apache POI for some time to read existing Excel 2003 files
I'm using apache poi to create an excel document. To create new sheet in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.