L
L
loljeene2014-11-28 10:24:22
Java
loljeene, 2014-11-28 10:24:22

Apache POI+Excel, how to split into parts?

Good afternoon. I am writing a program, the essence is this:
There is a large XLS file with a single sheet. It has a lot of data on it.
It is required to cut it into pieces (cut into pieces vertically).
The problem is this: When copying cells, styles, height, width, values ​​are transferred, but at the output we get a document without merged cells.
Here is the code to access all MergedRegions

for (int n = 0; n < sheet.getNumMergedRegions(); n++) {
                            CellRangeAddress mergedRegion = sheet.getMergedRegion(n);
                            // Just add it to the sheet on the new workbook.
                            sheet_out.addMergedRegion(mergedRegion);

How to select only those between lines m and n and apply them in the new document, given the line shift?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question