ozlerhakan/poiji

Repeated columns in @ExcelCellRange

furoraru opened this issue · 3 comments

Hi!

Suppose, I have a table with repeated nesting:

TypeJuneJuly
PlanDeltaSumPlanDeltaSum
type 1112123
type 2224325

Is there anything that can be done to make something like this to get pojo?

public class FilePojo {
    @ExcelCellName("Type")
    private String type;

    @ExcelCellName("June")   ----- use to find out the heading in which we will look for subheadings
    @ExcelCellRange()
    private Month june;

    @ExcelCellName("July")
    @ExcelCellRange()
    private Month july;

    public static class Month {
        @ExcelCellName("Plan")
        private Integer plan;

        @ExcelCellName("Delta")
        private Integer delta;

        @ExcelCellName("Sum")
        private Integer sum;
    }

}

Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)

Or maybe

public class FilePojo {
    @ExcelCellName("Type")
    private String type;

    @ExcelCellRange("June")   ----- use to find out the heading in which we will look for subheadings
    private Month june;

    @ExcelCellRange("July")
    private Month july;

    public static class Month {
        @ExcelCellName("Plan")
        private Integer plan;

        @ExcelCellName("Delta")
        private Integer delta;

        @ExcelCellName("Sum")
        private Integer sum;
    }

}

Hi @furoraru ,

You give different names for each headers line PlanA | DeltaA | SumA | PlanB | DeltaB | SumB. You can look at this test https://github.com/ozlerhakan/poiji/blob/master/src/test/java/com/poiji/deserialize/DeserializeByCellRangeTest.java