apache / apache/fesod

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

Open
#854 12 comments 0 reactions 0 assignees View on GitHub
discussion welcome help wanted
Dominant language
Java
Stars
6.2k
Forks
532
Avg merge
1d 3h
Merged PRs (30d)
42

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.