List of usage examples for org.apache.poi.xssf.streaming SXSSFSheet getMergedRegion
@Override public CellRangeAddress getMergedRegion(int index)
From source file:com.plugin.excel.util.ExcelUtil.java
License:Apache License
/** * /* ww w .ja v a2 s . com*/ * @param sheet * the sheet containing the data. * @param rowNum * the num of the row to copy. * @param cellNum * the num of the cell to copy. * @return the CellRangeAddress created. */ public static CellRangeAddress getMergedRegion(SXSSFSheet sheet, int rowNum, short cellNum) { for (int i = 0; i < sheet.getNumMergedRegions(); i++) { CellRangeAddress merged = sheet.getMergedRegion(i); if (merged.isInRange(rowNum, cellNum)) { return merged; } } return null; }