因为打印单据,有的行不想显示边框线,但是却不能完全去掉。我采用的方案:
 WritableFont wfc_title = new WritableFont(WritableFont.TIMES, 16, WritableFont.NO_BOLD, false);
WritableCellFormat wcfFc_title = new WritableCellFormat(wfc_title);
wcfFc_title.setBorder(jxl.format.Border.TOP,jxl.format.BorderLineStyle.NONE);  
wcfFc_title.setBorder(jxl.format.Border.LEFT,jxl.format.BorderLineStyle.NONE); 
wcfFc_title.setBorder(jxl.format.Border.RIGHT,jxl.format.BorderLineStyle.NONE); 
wcfFc_title.setBorder(jxl.format.Border.BOTTOM,jxl.format.BorderLineStyle.NONE); WritableCell cell = ws.getWritableCell(conditionCol,conditionRow);
if (cell.getType() == CellType.LABEL){
Label lb =(Label)cell;
lb.setString(ExcelSubTitle);
lb.setCellFormat(wcfFc_subtitle);
}
或者使用wcfFc_title.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.NONE); 效果也是一样,总是
有边框线。但是setBorder也不是完全不起作用,如果我把上面语句中的上、下、左、右的任一条边设成NONE之外的其他样式,显示就没问题,如:
wcfFc_title.setBorder(jxl.format.Border.TOP,jxl.format.BorderLineStyle.NONE);  
wcfFc_title.setBorder(jxl.format.Border.LEFT,jxl.format.BorderLineStyle.NONE); 
wcfFc_title.setBorder(jxl.format.Border.RIGHT,jxl.format.BorderLineStyle.NONE); 
wcfFc_title.setBorder(jxl.format.Border.BOTTOM,jxl.format.BorderLineStyle.THIN);
显示效果是只有单元格底部有边框,不知这是jxl的bug呢,还是我的用法有问题,请高手指点一下