excel - How to make text fit to xls column size in java -


i need make text shows nice in xls document. i'm using spring mvc xml view java. there code sample:

cellstyle style = workbook.createcellstyle(); hssfsheet sheet = workbook.createsheet("test"); sheet.setdefaultcolumnwidth(20); int worcount = 1; (object s : crimecaselist) {     hssfrow nrow = ud.createrow(rowcount++);     if(s.getclass().getname().equals("java.util.hashmap")) {        map<string, object> map = (hashmap<string,object>)s;        nrow.createcell(0).setcellvalue((map.get("rownum")==null)?"":            map.get("rownum").tostring());        .....     } } 

so, have lot of columns , there of text. need make nice. so, when text come end of column needs transfer on new line automaticaly , row should grow according text length. how can it?

may autosizecolumn(int) you. api


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -