|
@@ -17,6 +17,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
+import org.apache.poi.ss.util.CellRangeAddressBase;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
@@ -434,6 +435,7 @@ public class TrialSummaryController {
|
|
|
sheet.setForceFormulaRecalculation(true);
|
|
|
int all = 0;
|
|
|
List<CellRangeAddress> mergedRegions = sheet.getMergedRegions();
|
|
|
+ mergedRegions.sort(Comparator.comparingInt(CellRangeAddressBase::getFirstRow));
|
|
|
int xle = Math.min(mergedRegions.size(), 10);
|
|
|
for (int i = 0; i < xle; i++) {
|
|
|
CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
@@ -443,7 +445,7 @@ public class TrialSummaryController {
|
|
|
}
|
|
|
}
|
|
|
for (int i = 0; i < xle; i++) {
|
|
|
- CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
|
+ CellRangeAddress mergedCell = mergedRegions.get(i);
|
|
|
int xx = mergedCell.getLastColumn() + 2;
|
|
|
if (xx >= all) {
|
|
|
int fisRow = mergedCell.getFirstRow();
|