Skip to content

[Task] ExcelProperty添加分组字段,可以根据传参动态渲染表头数量 #854

@ESCATS

Description

@ESCATS

Motivation

如下案例:通过types定义每个字段,当我需要导出的时候传入all则渲染所有字段表头,传入school则只导出school相关的表头及数据
`package cn.idev.excel.test.demo.write;

import cn.idev.excel.annotation.ExcelProperty;
import lombok.Data;

@DaTa
public class SchoolWholeStatData {

@ExcelProperty(value = "学校名称", types = {"all", "school"})
private String schoolName;

@ExcelProperty(value = "学校地址", types = {"all", "school"})
private String schoolAddress;

@ExcelProperty(value = "学校编号", types = {"all", "school"})
private String schoolNo;

@ExcelProperty(value = "学生姓名", types = {"all", "student"})
private String studentName;

@ExcelProperty(value = "学生学号", types = {"all", "student"})
private String studentNo;

@ExcelProperty(value = "学生年龄", types = {"all", "student"})
private Integer studentAge;

@ExcelProperty(value = "学生身份证", types = {"all", "student"})
private String studentIdCard;

}`

How to complete

1、ExcelProperty注解新增分组
2、FastExcel.write()方法新增传入本次导出分组数据

Task List

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion welcomeWelcome to join the discussion togetherhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions