用jml匯出數字時,excel單元格格式化文字格式轉化成數字格式

wyc_L發表於2016-06-08

在做excel匯出時遇到數字匯出到excel裡面有了固定格式,從而導致資料不能直接修改的問題,以下是解決這種問題的方式!由於本人比較菜,寫下這個給自己以後做參考。

WritableFont  wf=new WritableFont (WritableFont .ARIAL,10,WritableFont .NO_BOLD,false);

DisplayFormat  displayFormat =NumberFormats.TEXT;

WritableCellFormat format=new  WritableCellFormat (wf,displayFormat );

format.setAlignment(jml.format.Alignment.LEFT);

format.setBorder(Border.ALL,BorderLineStyle.THIN);

Lable lab=new Lable(0,i,com.hollycrm.framework.util.StringUtil.killNull(zs.getxx()),format);

相關文章