急!!!HSSFWorkbook生成的execl的下拉列表时如何设置此单元格的默认值,请同志们指教!
答案:1 悬赏:10 手机版
解决时间 2021-05-15 03:42
- 提问者网友:贪了杯
- 2021-05-14 10:21
急!!!HSSFWorkbook生成的execl的下拉列表时如何设置此单元格的默认值,请同志们指教!
最佳答案
- 五星知识达人网友:西风乍起
- 2021-05-14 11:03
HSSFWorkbook wb = null;
try {
wb = new HSSFWorkbook(multipartFile.getInputStream());
logger.debug(wb.getNumberOfSheets());
HSSFSheet sheet = wb.getSheetAt(0);
Iterator<Row> rows = sheet.rowIterator();
List<List<String>> content = new ArrayList<List<String>>();
while(rows.hasNext()){
Row row = rows.next();
Iterator<Cell> cells = row.cellIterator();
List<String> line = new ArrayList<String>();
while(cells.hasNext()){
Cell cell = cells.next();
line.add(cell.getCellComment().getString().getString());
}
content.add(line);
}
return content;
} catch (Exception e) {
logger.error(e);
// throw new
// BusinessServiceException("未知原因!保存Excel文件时,请不要将鼠标最终定位在Excel中的可以下拉选值的列上。");
}
try {
wb = new HSSFWorkbook(multipartFile.getInputStream());
logger.debug(wb.getNumberOfSheets());
HSSFSheet sheet = wb.getSheetAt(0);
Iterator<Row> rows = sheet.rowIterator();
List<List<String>> content = new ArrayList<List<String>>();
while(rows.hasNext()){
Row row = rows.next();
Iterator<Cell> cells = row.cellIterator();
List<String> line = new ArrayList<String>();
while(cells.hasNext()){
Cell cell = cells.next();
line.add(cell.getCellComment().getString().getString());
}
content.add(line);
}
return content;
} catch (Exception e) {
logger.error(e);
// throw new
// BusinessServiceException("未知原因!保存Excel文件时,请不要将鼠标最终定位在Excel中的可以下拉选值的列上。");
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯