easyPoi导出excel

1.导入依赖

springboot项目:导入最新依赖,(最初导入低版本,先用了easyexcel,然后切换高版本easyexcel,然后引入easypoi,发现不好使,可能是版本问题,还是使用高版本靠谱些)

ERROR cn.afterturn.easypoi.excel.export.base.ExportBase - Excel导出错误
<dependency>
         <groupId>cn.afterturn</groupId>
         <artifactId>easypoi-spring-boot-starter</artifactId>
         <version>4.2.0</version>
 </dependency>

2.尝试小demo,使用注解方式,官网地址 :http://easypoi.mydoc.io/#text_186900

课程类 courseEntity。教师类,学生类,实现一对多导出(合并单元格)

package com.example.demo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;

import java.util.List;

@ExcelTarget("courseEntity")
public class CourseEntity implements java.io.Serializable {
    /** 主键 */
    private String        id;
    /** 课程名称 */
    @Excel(name = "课程名称", orderNum = "1", width = 25)
    private String        name;
    /** 老师主键 */
    @ExcelEntity(id =
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值