近段时间学习内容汇总

1.获取map的所有value

Collection value = map.values

2.poi导出的时候时间导出注意事项

CellStyle cellStyle = workbook.createCellStyle();
DataFormat formats = workbook.createDataFormat();
cellStyle.setDataFormat(formats.getFormat("yyyy-MM-dd hh:mm:ss"));
dataRow.getCell(9).setCellStyle(cellStyle);

3.poi导出字体颜色设置

//声明一个字体对象
        Font font = null;
        //创建一个字体对象
        font = workbook.createFont();
        //给字体对象设置颜色属性
        font.setColor(HSSFColor.RED.index);
        //将字体对象放入XSSFCellStyle对象中
        style.setFont(font);
        //将样式放入Cell对象中
        cell.setCellStyle(style);

4.poi导出单元格为合并单元格

CellRangeAddress region = new CellRangeAddress(起始行, 终止行, 起始列, 终止列);
//                        sheet.addMergedRegion(region);

5.poi判断单元格是否为空

public static boolean isRowEmpty(Row row){
        for (int i = row.getFirstCellNum(); i < row.getLastCellNum(); i++) {
            Cell cell = row.getCell(i);
            if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK){
                return false;
            }
        }
        return true;
  }
6.poi将单元格设为空

dataRow.createCell(12).setCellType(HSSFCell.CELL_TYPE_BLANK);

7.获取map的所有key

map.keySet();

8.poi实现自定义导出字段

https://blog.csdn.net/weixin_44736584/article/details/109457982

9.后台设置时间加上几个月

Calendar cal = Calendar.getInstance();
cal.setTime(addParam.getReleasedDate());
cal.add(Calendar.MONTH,月份);

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值