folks, I am able to read the excel sheet using apache POI in grails using this I am inserting the cell values into different tables of mysql, My problem is, I am not able to get the cell style like, bold or italic etc along with the data. generally text area will automatically give the style of text while inserting into database. I need to insert the data along with its style from each cell, please help me in solving it.
1 Answer
http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFCell.html#getCellStyle()
This should get the CellStyle from the cell, which then you can use to get the information you want.
-
Thank you xxpor, the getCellStyle() will return the object, after this only i got confused what to do/how to get the style using this object. Like, the way how can i get the style value using this object. can you please give me an example of it– AshwathMay 3, 2012 at 5:34
-
-
Like, suppose if i enter data inside cell with the bold style or italic i should be able to insert the same style attribute into database so that when i retrieve the same data from other front end i should be able to get the same style.– AshwathMay 3, 2012 at 5:41
-
I'm not sure how practical that is. If you look at the cell style documentation, you can see how many things there are. Is it bossible to store the binary blob of the excel file into the db?– xxporMay 3, 2012 at 5:45
-
I'll look into it again, Btw, i tried blob also, but in my appication i cant use blob as i'm performing many string operations at the front end it cause a problem– AshwathMay 3, 2012 at 5:50