`
7tianle
  • 浏览: 93219 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

java jxl

阅读更多
1、设置单元格的宽度:

WritableSheet sheetWrite=writeWorkbook.createSheet(pdName,i);
   sheetWrite.setColumnView(0, 4);//设置第一列的宽度为4
   sheetWrite.setColumnView(1, 23);//设置第二列的宽度为23
2、设置字体
WritableFont fontNormal= new WritableFont(WritableFont.ARIAL,11);
    WritableCellFormat cellFormat=new WritableCellFormat(fontNormal);
    cellFormat.setAlignment(jxl.format.Alignment.LEFT);
    cellFormat.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
    cellFormat.setWrap(true);
    label.setCellFormat(cellFormat);
    sheetWrite.addCell(label);
3、单元格居右
     Label label=new Label(column,row,labelValue);
    WritableCellFormat cellFormat=new WritableCellFormat();
    cellFormat.setAlignment(jxl.format.Alignment.RIGHT);
    label.setCellFormat(cellFormat);
    sheetWrite.addCell(label);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics