lisp对excel其他行列写入_关于POI导出EXCEL(单元格操作 行列操作)

@SuppressWarnings("deprecation")public static void excel(String xlsFile, String outXlsFile, TOrderExcel Tore, int rows) throwsFileNotFoundException, IOException {int i = 0;ArrayList arr = new ArrayLis...
摘要由CSDN通过智能技术生成

@SuppressWarnings("deprecation")public static void excel(String xlsFile, String outXlsFile, TOrderExcel Tore, int rows) throwsFileNotFoundException, IOException {int i = 0;

ArrayList arr = new ArrayList();

String filename=xlsFile;

XSSFWorkbook workbook= new XSSFWorkbook(newFileInputStream(filename));

XSSFSheet sheet = workbook.getSheetAt(0);

XSSFRow row= null, row1 = null;

XSSFCell cell, cell1;

// 读取模版for (int icount = 1; icount < 38; icount++) {

row=sheet.getRow(icount);

cell= row.getCell((short) 2);

System.out.println(cell);for (int j = 1; j < 10; j++) {

cell1= row.getCell((short) 1);

System.out.println(cell1);if(cell.toString().equals(cell1.toString())) {

getCell(row,3).setCellValue(cell1.toString());

}if (icount==2 && j==3) {if (!Utility.isEmpty(Tore.getName())) {

getCell(row, j).setCellValue(Tore.getName());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==2 && j==5) {if (!Utility.isEmpty(Tore.getSex())) {

getCell(row, j).setCellValue(Tore.getSex());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==2 && j==7) {if (!Utility.isEmpty(Tore.getBrithday()+"")) {

getCell(row, j).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(Tore.getBrithday()));

}else{

getCell(row, j).setCellValue("");

}

}if (icount==2 && j==9) {if (!Utility.isEmpty(Tore.getAaddress())) {

getCell(row, j).setCellValue(Tore.getAcity());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==3 && j==3) {if (!Utility.isEmpty(Tore.getEdu())) {

System.out.println(getCell(row,2).getRichStringCellValue());

getCell(row, j).setCellValue(Tore.getEdu());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==3 && j==5) {if (!Utility.isEmpty(Tore.getMarry())) {

getCell(row, j).setCellValue(Tore.getMarry());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==3 && j==7) {if (!Utility.isEmpty(Tore.getHmarry())) {

getCell(row, j).setCellValue(Tore.getHmarry());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==3 && j==9) {if (!Utility.isEmpty(Tore.getIndustry())) {

getCell(row, j).setCellValue(Tore.getIndustry());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==4 && j==3) {if (!Utility.isEmpty(Tore.getCredit_industry())) {

getCell(row, j).setCellValue(Tore.getCredit_industry());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==5 && j==3) {if (!Utility.isEmpty(Tore.getXaddress())) {

getCell(row, j).setCellValue(Tore.getXprovince()+Tore.getXcity()+Tore.getXarea()+Tore.getXaddress());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==6 && j==3) {if (!Utility.isEmpty(Tore.getPro_type())) {

String protype= "";if ("1".equals(Tore.getPro_type()))

protype= "一抵";elseprotype= "二抵";

getCell(row, j).setCellValue(protype);

}else{

getCell(row, j).setCellValue("");

}

}if (icount==6 && j==5) {if (!Utility.isEmpty(Tore.getHaddress())) {

getCell(row, j).setCellValue(Tore.getHprovince()+Tore.getHcity()+Tore.getHarea()+Tore.getHaddress());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==7 && j==3) {if (!Utility.isEmpty(Tore.getBuildyear())) {

getCell(row, j).setCellValue(Tore.getBuildyear()+"年");

}else{

getCell(row, j).setCellValue("");

}

}if (icount==7 && j==5) {if (!Utility.isEmpty(Tore.getNums_floor()+"")) {

getCell(row, j).setCellValue(Tore.getNums_floor());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==7 && j==7) {if (!Utility.isEmpty(Tore.getFloor()+"")) {

getCell(row, j).setCellValue(Tore.getFloor());

}else{

getCell(row, j).setCellValue("");

}

}if (icount==7 && j==9) {if (!Utility.isEmpty(Tore.getBuildarea()+"")) {

getCell(row, j).setCellValue(Tore.getBuildarea()+"平方米");

}else{

getCell(row, j).setCellValue("");

}

}if (icount==8 && j==3) {if (!Utility.isEmpty(Tore.getMoney()+"")) {

getCell(row, j).setCellValue(Tore.getMoney()+"万元");

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值