ozlerhakan / poiji

:candy: A library converting XLS and XLSX files to a list of Java objects based on Apache POI

Home Page:https://ozlerhakan.github.io/poiji/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling list of Objects

hendryang opened this issue · comments

Hi Ozler,

Any idea how to I handle such scenario?

Given I have table below , ( I can't merge cell with MD , but assume Person 1 is merge cell for column B,C,D. same goes to Person 2 and Person 3)

This is basically a list of 3 Person objects within a single table, is there a way to handle such scenario that we can map those 3 persons to List<Person> ? Thank you

Data Person 1 Person 2 Person 3
Name Gender Age Name Gender Age Name Gender Age
1 test male 10 gogo female 20
2 abc male 30 vivi female 40 vava female 40

using @ExcelCellName("Name") seems to only take the last "Name" column such as "null" and "vava"

also tried my luck with @ExcelRange... List<PersonInfo> persons; , but it doesn't support map to List

Hi @hendryang ,

Thanks for bringing this up. You're right @ExcelRange doesn't fit for this case. Why you don't convert data to this one first:

Screen Shot 2021-11-13 at 19 10 12

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.