• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

POI issue with writing data to cell in excel sheet

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am writing data to excel sheet using POI

Now when i am trying to write the BigDecimal value to a cell using following code


where

partBean.getBestBuyFactor()

is a BigDecimal value 1 but it is getting written to the cell as 1.000
because POI is treating it as a

text

and not as

number



so i tried setting the cellType as

cell.setCellType(Cell.CELL_TYPE_NUMERIC);

but still POI is treating it as a string.

So can any one please help me why this is happening and how to resolve it?

I am attaching the screenshot of the excel sheet data.

Thanks in advance
Prashant
POI-problem.JPG
[Thumbnail for POI-problem.JPG]
 
She'll be back. I'm just gonna wait here. With this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic