Forums > Help! > Please Help, problem with cellType

Login/Join to Participate



Total posts: 1
Posted:Hello Friends,
I am new to Poi world. I am facing one problem.

My requirement is that I want a excel sheet in which format type of cells of first column should always be a Text. For other columns the format type may be general or numeric.
Why I require first columns format type as text, because when ever user is entering long number in excel it automatically converts that to scientific notation. Like if I entered value 123456789012 in cell it automatically becomes 1.23457E+11. I was programmatically creating Excel by using Poi.

I dont want such behavior at least in first column of excel sheet. To avoid this, what I have done is instead of dynamically generating excel sheet I am keeping the predefined excel file and made its first columns property as a Text. This approach is working fine for all cells in the first column except in which I am adding some value dynamically through program. Its type automatically becomes General from Text. But the cells in the first column which are empty are still showing me the property type as Text.
To overcome this I have used following code,

HSSFCellStyle cellStyle = cell.getCellStyle();

And for other cells in other column I am again setting type as cell.setCellType(CELL_TYPE_NUMERIC);

But what I observed is that now all cells type becomes Text. If I dont use setDataFormat for first column and if only use setCellType, its type is not changing to text it remains to General only. I am using 2.5 version of Poi.

Can you please help me out from this problem?

Thanks and Regards,
Sachin Dare.

Delete Topic



Location: Oregon, USA

Total posts: 577
3 bt weave?

No.. wait, I know the answer to this..



You may want to look into the site a little more before posting. You may want to research who you are asking before you ask. You also may want to go back to your search engine and continue your search.

Good luck, you're in the wrong place. This poi is at least at version aught'6.

Definition of poi- A Hawaiian food made from the tuber of the taro that is cooked, pounded to a paste, and fermented.

Ahnold discussing poi - "It is naht a toober!"


BRONZE Member since Nov 2001


Carpal \'Tunnel
Location: Europe,Scotland,Both

Total posts: 3749
Posted:LOL ubblol

thats the trouble with the internet, they let anyone on here (unless your chineeze)

This is a post by tom, all spelling is deleberate
-><- Kallisti



Location: uk

Total posts: 328
Posted:You might want to try Jakarta POI 2.5.1, just a thought, or perhaps poi-3.0-alpha1.



GOLD Member since Aug 2005


HOP's glowstick ambassador!!
Location: Bay Area, California, USA

Total posts: 128
Posted:???? huh? umm

maybe if you lit the annoying column cells on fire?

missegyptology: "I just remember beingall off balance and unicycling really fast down to campus and the arabic was all blurred on the page"

^When Linz pulls an all nighter before Arabic class^


flash fire
BRONZE Member since Jan 2001

flash fire

Sporadically Prodigal
Location: Sydney, NSW, Australia

Total posts: 2758
Posted:Different sort of poi. See our home page, and you'll soon realise that.

HoP Posting Guidelines
Is it the Truth?
Is it Fair to all concerned?
Will it build Goodwill and Better Friendships?
Will it be Beneficial to all concerned?
If you can answer YES to these 4 questions then you may post a reply.


Similar Topics

Using the keywords [problem celltype] we found the following similar topics.
1. Learn > Cartoons, Fun, Jokes > Pictures, Cartoons, Meme > The New 2 Person Hoop, only has one problem *help/resource
2. Forums > Please Help, problem with cellType [5 replies]
3. Forums > Board 'quote' function problem [9 replies]
4. Forums > Wick problem [1 reply]
5. Forums > 'nother small problem [31 replies]

     Show more..