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

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

Introduction

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

Prototype

int[] getRowBreaks();

Source Link

Document

Retrieves all the horizontal page breaks

Usage

From source file:net.sf.excelutils.ExcelUtils.java

License:Apache License

/**
 * parse Excel Template File/*from w ww  .  ja  v  a 2 s . com*/
 * 
 * @param context datasource
 * @param sheet Workbook sheet
 */
public static void parseSheet(Object context, Workbook wb, Sheet sheet) throws ExcelException {
    try {
        ExcelParser.parse(context, wb, sheet, sheet.getFirstRowNum(), sheet.getLastRowNum());
        try {
            // remove the last #page
            int breaks[] = sheet.getRowBreaks();
            if (breaks.length > 0) {
                sheet.removeRowBreak(breaks[breaks.length - 1]);
            }
        } catch (Exception ne) {
        }
    } catch (Exception e) {
        throw new ExcelException("parseSheet error: ", e);
    } finally {
        ExcelUtils.context.set(null);
    }
}

From source file:org.bbreak.excella.reports.ReportsTestUtil.java

License:Open Source License

/**
 * ????/*from   w  ww .  j  ava2  s. c  o  m*/
 * 
 * @param sheet 
 * @return ??
 */
private static String getBreaksString(Sheet sheet) {

    return "row=" + Arrays.toString(sheet.getRowBreaks()) + ",column="
            + Arrays.toString(sheet.getColumnBreaks());

}