如何让导出的EXCEL单元格是数字型的?
代码如下:WritableWorkbook copy = Workbook.createWorkbook(new File(Constant.LILE_UPLOAD_PLAN_FOLDER+sDate+"-"+user.getRole().getKcppai()+"-销售日报.xls"));
//第0个sheet是
WritableSheet sheet = copy.createSheet("销售日报", 0);
//样式
WritableFont font = new WritableFont(WritableFont.TIMES, 8);
font.setColour(Colour.RED);// 红色字体
WritableCellFormat format = new WritableCellFormat(font);
sheet.addCell(new Label(0,0,"系列",this.getAllUCell()));
sheet.mergeCells(0, 0, 0, 1);//第一个参数为列起始下标,第二个参数为行起始下标,第三个参数为列终止下标,第四个参数为行终止下标
sheet.addCell(new Label(1,0,"月",this.getAllUCell()));
sheet.mergeCells(1, 0, 5, 0);
sheet.addCell(new Label(6,0,"年",this.getAllUCell()));
sheet.mergeCells(6, 0, 8, 0);
sheet.addCell(new Label(1,1,"月初库存",this.getAllUCell()));
sheet.addCell(new Label(2,1,"入库",this.getAllUCell()));
sheet.addCell(new Label(3,1,"开发票",this.getAllUCell()));
sheet.addCell(new Label(4,1,"销售额(万元)",this.getAllUCell()));
sheet.addCell(new Label(5,1,"月末库存",this.getAllUCell()));
sheet.addCell(new Label(6,1,"年入库",this.getAllUCell()));
sheet.addCell(new Label(7,1,"年开发票",this.getAllUCell()));
sheet.addCell(new Label(8,1,"年销售额(万元)",this.getAllUCell()));
for(int i=0; i<dataList.size();i++){
ReportInterim dt = dataList.get(i);
sheet.addCell(new Label(0,i+2,dt.getChar2(),this.getAllUCell()));
sheet.addCell(new Label(1,i+2,dt.getChar3(),this.getAllUCell()));
sheet.addCell(new Label(2,i+2,dt.getChar4(),this.getAllUCell()));
sheet.addCell(new Label(3,i+2,dt.getChar5(),this.getAllUCell()));
sheet.addCell(new Label(4,i+2,dt.getChar6(),this.getAllUCell()));
sheet.addCell(new Label(5,i+2,dt.getChar7(),this.getAllUCell()));
}
上面代码导出的excel单元格都是文本型的,无法参加计算,如何让导出的格式为数字型的?急等解答,谢谢