问题描述
RT.里面的行数是动态迭代上去的.第四个栏位会有个批注.如何添加批注?还有个问题.能否清空Cell的内容.我现在是cell.setString("");来做的.但这只是Label.如果是Number的话.只能给0?有没有一个方法直接删除掉内容?
解决方案
jxl添加批注是这样添加的,jxl的demo上有现成的例子Label l = new Label(0, 57, "A cell with a comment");WritableCellFeatures cellFeatures = new WritableCellFeatures();cellFeatures.setComment("the cell comment");l.setCellFeatures(cellFeatures);
解决方案二:
另外,添加一个空的cell,要用到jxl.write.Blank。下面是 jxl上的API doc关于这个类的说明:A blank cell. Despite not having any contents, it may contain formatting information. Such cells are typically used when creating templatesConstructor SummaryBlank(Cell lc) Constructor used internally by the application when making a writable copy of a spreadsheet being read inBlank(int c, int r) Creates a cell which, when added to the sheet, will be presented at the specified column and row co-ordinatesBlank(int c, int r, CellFormat st) Creates a cell which, when added to the sheet, will be presented at the specified column and row co-ordinates in the manner specified by the CellFormat parameter