Example usage for org.apache.poi.ss.usermodel Sheet getMergedRegion

List of usage examples for org.apache.poi.ss.usermodel Sheet getMergedRegion

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel Sheet getMergedRegion.

Prototype

public CellRangeAddress getMergedRegion(int index);

Source Link

Document

Returns the merged region at the specified index

Usage

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;
}