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

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

Introduction

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

Prototype

public static Cell getCell(Row row, int columnIndex) 

Source Link

Document

Get a specific cell from a row.

Usage

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  ww  w .  ja v  a2s .  co m*/
    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());
}