Example usage for org.apache.poi.ss.util CellUtil getRow

List of usage examples for org.apache.poi.ss.util CellUtil getRow

Introduction

In this page you can find the example usage for org.apache.poi.ss.util CellUtil getRow.

Prototype

public static Row getRow(int rowIndex, Sheet sheet) 

Source Link

Document

Get a row from the spreadsheet, and create it if it doesn't exist.

Usage

From source file:com.phucdk.emailsender.utils.ExcelUtils.java

private static Cell getCell(int row, int column, XSSFSheet sheet) {
    return CellUtil.getRow(row, sheet).getCell(column);
}

From source file:com.wabacus.system.assistant.StandardExcelAssistant.java

License:Open Source License

private void createRowAndColInRegion(Sheet sheet, CellRangeAddress region, CellStyle cellStyle) {
    Row rowTmp;//from   w  w w .  j  a  va2 s.com
    Cell cellTmp;
    for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) {
        rowTmp = CellUtil.getRow(i, sheet);
        for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) {
            cellTmp = CellUtil.getCell(rowTmp, j);
            cellTmp.setCellStyle(cellStyle);
        }
    }
}

From source file:org.openmrs.module.reporting.report.renderer.XlsReportRendererTest.java

License:Open Source License

public void testValue(Workbook wb, String sheetName, int rowNum, int colNum, String value) {
    Sheet sheet = wb.getSheet(sheetName);
    Row row = CellUtil.getRow(rowNum - 1, sheet);
    Cell cell = CellUtil.getCell(row, colNum - 1);
    Assert.assertEquals(value.toLowerCase(), cell.getStringCellValue().toLowerCase());
}