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
Post a Comment