EasyPoi-导出动态表头-自动新增序号-数据合并单元格

需求背景:

动态导出表头,特定表头下数据记录一样的需要合并单元格。在导出的首列加上导出序号。

解决方案:

使用EasyPoi 的map 方式来实现。直接贴代码。

EasyPoi文档地址:风铃开源文档-旧版

public static void main(String[] args) {
        try {
            List<ExcelExportEntity> colList = new ArrayList<ExcelExportEntity>();
            ExcelExportEntity xh = new ExcelExportEntity("序号", "xh");
            xh.setFormat("isAddIndex");
            colList.add(xh);
            ExcelExportEntity colEntity = new ExcelExportEntity("工厂单元", "factoryArea");
            //colEntity.setNeedMerge(true);
            colEntity.setMergeVertical(true);
            colList.add(colEntity);

            colEntity = new ExcelExportEntity("物料", "material");
            //colEntity.setNeedMerge(true);
            colEntity.setMerge
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值