List of usage examples for org.apache.poi.ss.usermodel Sheet getMergedRegion
public CellRangeAddress getMergedRegion(int index);
From source file:uk.co.spudsoft.birt.emitters.excel.handlers.PageHandler.java
License:Open Source License
private CellRangeAddress getMergedRegionBegunBy(Sheet sheet, int row, int col) { for (int i = 0; i < sheet.getNumMergedRegions(); ++i) { CellRangeAddress range = sheet.getMergedRegion(i); if ((range.getFirstColumn() == col) && (range.getFirstRow() == row)) { return range; }//from w ww .j a va 2 s . com } return null; }
From source file:uk.co.spudsoft.birt.emitters.excel.tests.ReportRunner.java
License:Open Source License
public boolean mergedRegion(Sheet sheet, int top, int left, int bottom, int right) { for (int i = 0; i < sheet.getNumMergedRegions(); ++i) { CellRangeAddress curRegion = sheet.getMergedRegion(i); if ((curRegion.getFirstRow() == top) && (curRegion.getFirstColumn() == left) && (curRegion.getLastRow() == bottom) && (curRegion.getLastColumn() == right)) { return true; }//from w w w . j a v a 2s . co m } return false; }