Answer the question
In order to leave comments, you need to log in
How to find out the "length" of a cell in Apache Poi?
Reading xlsx using apache poi. What if the exact format is not known in advance, but I know that there are merged cells in the file? How can I see the length of a cell? Those. How many columns does it span? For example, there is a cell merged "B2:C2", I got its Cell object, but I do not find a single method in it that allows you to find out how many columns it is stretched (if, of course, it is stretched at all). How to find out?
Answer the question
In order to leave comments, you need to log in
Merged cells - a group of ordinary cells, the value is stored in the upper right corner. Thus, when you receive a Cell object, you do not get a merged cell, but a piece of it (with or without a value).
To determine if a cell belongs to a merged group, you can use the code from here . You can calculate the length using it with a rather trivial method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question