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

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

Introduction

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

Prototype

void removeRowBreak(int row);

Source Link

Document

Removes the page break at the indicated row

Usage

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

License:Apache License

/**
 * parse Excel Template File/*ww  w. j  a va2  s. c  o  m*/
 * 
 * @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);
    }
}