Repeated columns in @ExcelCellRange
furoraru opened this issue · 3 comments
furoraru commented
Hi!
Suppose, I have a table with repeated nesting:
Type | June | July | ||||
---|---|---|---|---|---|---|
Plan | Delta | Sum | Plan | Delta | Sum | |
type 1 | 1 | 1 | 2 | 1 | 2 | 3 |
type 2 | 2 | 2 | 4 | 3 | 2 | 5 |
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;
}
}
github-actions commented
Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)
furoraru commented
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;
}
}
ozlerhakan commented
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