第一种方式:使用poi组件,适用于excel中有列表的,
第二种方式:使用字符串的替换,适用于单条数据,要有excel模板
HSSFSheet sheet = work.getSheetAt(0);
Map maptask = tOverhualtaskService.getOverhualTaskById(taskId);
HSSFRow row = sheet.getRow(0); // 得到第一行
HSSFCell cell = row.getCell(26);
String date = cell.getStringCellValue();
date = date.replace("${date}",simpleFormat.format(new Date()));
版权声明:本文为博主原创文章,未经博主允许不得转载。