• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

apache poi program reading excel numerical values issue

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

I am running above program to read values from excel, query database and see all excel values are present in database or not.

If the excel values are not there in database then it will create missing list send missing list to user as the excel file.

Everything working fine as long as everything is string. But in the excel the password instead of string if I give numerical values as in attachemnt ie instead of say aaa if i give 123456789 then the program is not querying properly.

I tried following link suggestion
http://stackoverflow.com/questions/5578535/get-cell-value-from-excel-sheet-with-apache-poi

cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
but did not help much but in console earlier numeric used to be read 1.23456789(something like double) but after
cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
placing the line before reading the cell that issue fixed and reading as 123456789 itself


I went to excel column and changed all the individual cell properties which also did not help.


It is thinking all the excel values not present in database and sending email of all values. Looks like APache POI is not reading the excel numerical values properly hence not able to query database properly and hence not able to judge properly whether those values are there in database or not. So even the excel values are there in database program thinking excel values not there in database and sending missingist report with all the excel values. Please advise how can I fix this numerical issue of the Apachi poi reading issue.Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
excelViiew.JPG
[Thumbnail for excelViiew.JPG]
excel
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving discussion as too difficult for “beginning”.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic