startColNum=startColNum+2;
ws.addCell(new Label(startColNum,rowIndx,(i%2==0) "男":"女",wcf_value));
ws.mergeCells(startColNum, rowIndx, startColNum+1, rowIndx);
startColNum=startColNum+2;
ws.addCell(new Number(startColNum,rowIndx,i+15,wcf_value));
ws.mergeCells(startColNum, rowIndx, startColNum+1, rowIndx);
startColNum=startColNum+2;
ws.addCell(new Label(startColNum,rowIndx,"住址"+i,wcf_value));
startColNum=0;
}
wb.write();
wb.close();
}
//生成空单元格
for(int r=0;r
ws.addCell(new Label(startColNums+c,startRows+r,""));
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
public static void main(String[] args) throws Exception {
File file = new File("D:\\text.xls");
file.createNewFile();
new ExcelReport().genarateExcel(file);
}
}
本文出自“greatjone”