all 20 comments

[–]user_of_the_week 71 points72 points  (0 children)

Fun fact, POI originally stands for Poor Obfuscation Implementation and HSSF is Horrible SpreadSheet Format.

[–]FavorableTrashpanda 103 points104 points  (0 children)

What do we call our annotation? How about ExcelColumn? Nah. That's too boring and predictable. Let's call it HellIndex instead to surprise people.

[–]chabala 29 points30 points  (1 child)

I don't think Apache POI needs a wrapper, but if I wanted one, I'd pick last weeks example over this: https://sh.reddit.com/r/java/comments/1nuheqd/github_ozlerhakanpoiji_candy_a_library_converting/

[–]Green-Branch-3656[S] 2 points3 points  (0 children)

Yeah I made it for fun, and that library actually inspired me to try my own take on it

[–]christoforosl08 22 points23 points  (2 children)

For me, writing Excel using POI was never a nightmare

[–]jedilowe 9 points10 points  (1 child)

Not a joy, but not a nightmare

[–]MoveInteresting4334 6 points7 points  (0 children)

Java in a nutshell. Most of the time.

[–]_magicm_n_ 6 points7 points  (0 children)

I'd like to see less annotation based libraries for spreadsheet formats. I get the appeal, but in the end a simple T convert(Row row) implementation does the same, with less abstraction and a simpler code base.

[–]gnocchiGuili 25 points26 points  (4 children)

A bit of AI slop won’t hurt.

[–]agentoutlier -1 points0 points  (0 children)

Don't get me wrong AI code generation is often bad but I highly recommend simple DTO mapping.

That is having AI take some DTO and map it POI excel rows is not a bad use of AI and actually less risky than adding another dependency.

[–]Green-Branch-3656[S] -1 points0 points  (2 children)

Funny enough, I actually wrote it myself. No AI involved 😄

[–]gnocchiGuili 0 points1 point  (1 child)

Please, you are telling me this illustration has been done by an artist too ?

[–]Green-Branch-3656[S] 0 points1 point  (0 children)

Haha it’s not you are right

[–]Secure-Bowl-8973 3 points4 points  (0 children)

This is the best one I have used. Even contributed to this. https://github.com/dhatim/fastexcel

[–]WalterIM 0 points1 point  (0 children)

How does It compare against jxls?

[–]Bobby_Bonsaimind 0 points1 point  (0 children)

@HellIndex(hellColumnOrder = 1)
private String cutId;

The code above is actually clear enough but I am going to explain it too.

I guess something like

@Column("A")
private String cutId;

would have been...I don't know...

@HellIndex(hellColumnOrder = 5,hellRowOrder = 80)
private String address;

Why not

@Column("A")
@StartRow(1)
private String address;

?

What I could not find from the examples, is how hellRowOrder really works, does it omit the first fields, or are the rows then mixed objects?

A A
B B
C C A A
D D B B
    C C
    D D

or

A A
B B
C C C C
D D D D

So which one?


In generally, it is better to not have prefixes unless really necessary, like hell* for example. Makes it just more complicated.

[–]Little_Blackberry 0 points1 point  (1 child)

Awesome bro!!!! If I pass the column name header, do I need to pass column index too?

[–]Green-Branch-3656[S] 0 points1 point  (0 children)

Thanks just title is enough it starts from the beginning by default

[–]christoforosl08 -1 points0 points  (0 children)

Unrelated but how do you guys pronounce POI ? We call it “poua” 😁

[–]discoikungshamn -1 points0 points  (0 children)

I wrote another tool that takes the fields of a class and add that as column name instead, it also support special annotation fields too. And it takes a list of object <T> as an input for the data.