easypoi自定义导出表格(多级表头)

 想要自定义导出复杂表头的EXCEL表格(三级表头+),在使用easypoi的情况下只能使用Map导出格式

ExcelExportEntity entity = new ExcelExportEntity();

此对象为导出EXCEL表格表格头的构建对象,其中有个list属性,这个属性就是多级表头的实现基础

一下为导出多级表头的代码示例

exportList.add(new ExcelExportEntity("列名", "列对应的字段"));

示例代码

// exportList为表头总的集合,导出的EXCEL表格的表头完全是按照这个来生成的
List<ExcelExportEntity> exportList = new ArrayList<>();
    // 创建最底部的一级表头10个
    ExcelExportEntity A1 = new ExcelExportEntity("一级表头A1", "a1");
    ExcelExportEntity A2 = new ExcelExportEntity("一级表头A2", "a2");
    ExcelExportEntity B1 = new ExcelExportEntity("一级表头B1", "b1");
    ExcelExportEntity B2 = new ExcelExportEntity("一级表头B2", "b2");
    ExcelExportEntity B3 = new ExcelExportEntity("一级表头B3", "b3");
    ExcelExportEntity C1 = new ExcelExportEntity("一级表头C1", "c1");
    ExcelExportEntity C2 = new ExcelExportEntity("一级表头C2", "c2");
    ExcelExportEntity D1 = new ExcelExportEntity("一级表头D1", "d1");
    ExcelExportEntity D2 = new ExcelExportEntity("一级表头D2", "d2");
    ExcelExportEntity D3 = new ExcelExportEntity
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值