Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

注解ExcelProperty index 属性是否可以被定义为对应列在表头集合中的排序条件,而不是列的编号 #4045

@cuivip

Description

@cuivip

建议描述

public class DataModel {
    @ExcelProperty(index = 0)
    private String column1;

    @ExcelProperty(index = 2)
    private String column3;

    // getters and setters
}

上面的bean导出时,会有1个空列,因为index =1 缺失。是否可以将index的值处理为排序条件,只要保证column1 可以排在 column2前面即可,哪怕index分别是 11,34 这样在处理多列导出文件时会更方便

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions