Example usage for org.apache.poi.ss.usermodel Row setHeight

List of usage examples for org.apache.poi.ss.usermodel Row setHeight

Introduction

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

Prototype

void setHeight(short height);

Source Link

Document

Set the row's height or set to ff (-1) for undefined/default-height.

Usage

From source file:gregchen.Simulation.java

License:Open Source License

 private void initializeExcelFile()
{
   //short rownum;
   //Create a Data folder if it does not already exist
   File theDir = new File("Data");
   //if the directory does not exist, create it
   if(!theDir.exists())
   {// www. jav a2s.c  om
      theDir.mkdir();
   }
   // create a new file
      
   if(fileCount == 0)
   {
      File file = null;
      do
      {
         fileCount++;
         file = new File("Data/Data " + fileCount + ".xls");
      }while(file.exists());
   }
      
   try {
      excelOut = new FileOutputStream("Data/Data " + fileCount + ".xls");
   } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
   }
      
   fileCount++;
      
   // create a new workbook
   wb = new HSSFWorkbook();
   // create a new sheet
   s = wb.createSheet();
   // declare a row object reference
   Row r = null;
   // declare a cell object reference
   Cell c = null;
   // create 3 cell styles
   CellStyle cs = wb.createCellStyle();
   CellStyle cs2 = wb.createCellStyle();
   CellStyle cs3 = wb.createCellStyle();
   DataFormat df = wb.createDataFormat();
   // create 2 fonts objects
   Font f = wb.createFont();
   Font f2 = wb.createFont();

   //set font 1 to 12 point type
   f.setFontHeightInPoints((short) 12);
   //make it blue
   f.setColor( (short)0xc );
   // make it bold
   //arial is the default font
   f.setBoldweight(Font.BOLDWEIGHT_BOLD);

   //set font 2 to 10 point type
   f2.setFontHeightInPoints((short) 10);
   //make it red
   f2.setColor( (short)Font.COLOR_RED );
   //make it bold
   f2.setBoldweight(Font.BOLDWEIGHT_BOLD);

   f2.setStrikeout( true );

   //set cell stlye
   cs.setFont(f);
   //set the cell format 
   cs.setDataFormat(df.getFormat("#,##0.0"));

   //set a thin border
   cs2.setBorderBottom(cs2.BORDER_THIN);
   //fill w fg fill color
   cs2.setFillPattern((short) CellStyle.SOLID_FOREGROUND);
   //set the cell format to text see DataFormat for a full list
   cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));

   // set the font
   cs2.setFont(f2);

   // set the sheet name in Unicode
   wb.setSheetName(0, "Greg Chen");
   // in case of plain ascii
   // wb.setSheetName(0, "HSSF Test");
   // Make header cells
      
   r = s.createRow(0);
   c = r.createCell(7);
   c.setCellStyle(cs3);
      
   c.setCellValue("Initial number: " + initialNumber + " Number per release: " + numPerRelease
         + " Number Releases: " + numReleases + " Release Interval: " + releaseInterval
         + " Female lethal gene: " + fsRIDL);
      
   currentRow = 2;
   for (short cellnum = (short) 0; cellnum < 7; cellnum ++)
    {
        // create a numeric cell
        c = r.createCell(cellnum);
        // do some goofy math to demonstrate decimals
        String heading = null;
        switch(cellnum)
        {
        case 0:
           heading = "Day"; break;
        case 1:
           heading = "Total Population"; break;
        case 2:
           heading = "Male Population"; break;
        case 3:
           heading = "Female Population"; break;
        case 4:
           heading = "FF"; break;
        case 5:
           heading = "Ff"; break;
        case 6:
           heading = "ff"; break;
        }
           
        c.setCellValue(heading);

          
         // set this cell to the first cell style we defined
         c.setCellStyle(cs);
         // set the cell's string value to "Test"

        // make this column a bit wider
         if(cellnum > 0)
         {
            s.setColumnWidth((short) (cellnum), (short) ((300) / ((double) 1 / 20)));
         }
        r.setHeight((short) 800);
    }
   /*
   int rownum;
   for (rownum = (short) 0; rownum < 30; rownum++)
   {
       // create a row
       r = s.createRow(rownum);
      
       r.setHeight((short) 0x249);


       //
         
   }

   //draw a thick black border on the row at the bottom using BLANKS
   // advance 2 rows
   rownum++;
   rownum++;

   r = s.createRow(rownum);

   // define the third style to be the default
   // except with a thick black border at the bottom
   cs3.setBorderBottom(cs3.BORDER_THICK);

   */
      
   // write the workbook to the output stream
   // close our file (don't blow out our file handles)
          
}

From source file:nc.noumea.mairie.appock.services.impl.ExportExcelServiceImpl.java

License:Open Source License

private Row createRowGeneric(Sheet sheet, int ligne, Integer taille) {
    Row row = sheet.createRow(ligne);
    if (taille != null) {
        row.setHeight((short) taille.intValue());
    }//from   w ww.j  av a  2 s  .c om

    return row;
}

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

License:Apache License

/**
 * copy row/*from   w  w w  . j  a v  a2s. c  o m*/
 *
 * @param sheet
 * @param from begin of the row
 * @param to destination fo the row
 * @param count count of copy
 */
public static void copyRow(Sheet sheet, int from, int to, int count) {

    for (int rownum = from; rownum < from + count; rownum++) {
        Row fromRow = sheet.getRow(rownum);
        Row toRow = getRow(to + rownum - from, sheet);
        if (null == fromRow)
            return;
        toRow.setHeight(fromRow.getHeight());
        toRow.setHeightInPoints(fromRow.getHeightInPoints());
        int lastCellNum = fromRow.getLastCellNum();
        lastCellNum = lastCellNum > 255 ? 255 : lastCellNum;
        for (int i = fromRow.getFirstCellNum(); i <= lastCellNum && i >= 0; i++) {
            Cell fromCell = getCell(fromRow, i);
            Cell toCell = getCell(toRow, i);
            // toCell.setEncoding(fromCell.getEncoding());
            toCell.setCellStyle(fromCell.getCellStyle());
            toCell.setCellType(fromCell.getCellType());
            switch (fromCell.getCellType()) {
            case Cell.CELL_TYPE_BOOLEAN:
                toCell.setCellValue(fromCell.getBooleanCellValue());
                break;
            case Cell.CELL_TYPE_FORMULA:
                toCell.setCellFormula(fromCell.getCellFormula());
                break;
            case Cell.CELL_TYPE_NUMERIC:
                toCell.setCellValue(fromCell.getNumericCellValue());
                break;
            case Cell.CELL_TYPE_STRING:
                toCell.setCellValue(fromCell.getStringCellValue());
                break;
            default:
            }
        }
    }

    // copy merged region
    List shiftedRegions = new ArrayList();
    for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
        CellRangeAddress r = sheet.getMergedRegion(i);
        if (r.getFirstRow() >= from && r.getLastRow() < from + count) {
            CellRangeAddress n_r = new CellRangeAddress(r.getFirstRow() + to - from, r.getLastRow() + to - from,
                    r.getFirstColumn(), r.getLastColumn());
            shiftedRegions.add(n_r);
        }
    }

    // readd so it doesn't get shifted again
    Iterator iterator = shiftedRegions.iterator();
    while (iterator.hasNext()) {
        CellRangeAddress region = (CellRangeAddress) iterator.next();
        sheet.addMergedRegion(region);
    }
}

From source file:org.apache.tika.eval.reports.Report.java

License:Apache License

private void dumpReportToWorkbook(Statement st, SXSSFWorkbook wb) throws IOException, SQLException {
    ResultSet rs = st.executeQuery(sql);

    SXSSFSheet sheet = wb.createSheet("tika-eval Report");
    sheet.trackColumnForAutoSizing(0);/*from  w w  w .j a  v  a  2 s  .  c  o m*/

    int rowCount = 0;
    ResultSetMetaData meta = rs.getMetaData();
    Set<String> colNames = new HashSet<>();

    Row xssfRow = sheet.createRow(rowCount++);
    //write headers and cache them to check against styles
    for (int i = 1; i <= meta.getColumnCount(); i++) {
        Cell cell = xssfRow.createCell(i - 1);
        cell.setCellValue(meta.getColumnLabel(i));
        colNames.add(meta.getColumnLabel(i));
    }

    ResultSetMetaData resultSetMetaData = rs.getMetaData();
    while (rs.next()) {
        xssfRow = sheet.createRow(rowCount++);
        for (int i = 1; i <= meta.getColumnCount(); i++) {
            Cell cell = xssfRow.createCell(i - 1);
            XSLXCellFormatter formatter = cellFormatters.get(meta.getColumnLabel(i));
            if (formatter == null) {
                formatter = getDefaultFormatter(resultSetMetaData.getColumnType(i));
            }
            if (formatter != null) {
                formatter.applyStyleAndValue(i, rs, cell);
            } else {
                writeCell(meta, i, rs, cell);
            }
        }
    }
    sheet.autoSizeColumn(0);

    if (!includeSql) {
        return;
    }

    SXSSFSheet sqlSheet = wb.createSheet("tika-eval SQL");
    sqlSheet.setColumnWidth(0, 100 * 250);
    Row sqlRow = sqlSheet.createRow(0);
    short height = 5000;
    sqlRow.setHeight(height);
    Cell cell = sqlRow.createCell(0);
    cell.setCellStyle(sqlCellStyle);

    cell.setCellValue(sql.trim());//.replaceAll("[\r\n]+", "\r\n"));
}

From source file:org.bbreak.excella.core.util.PoiUtil.java

License:Open Source License

/**
 * ?//from w w  w .j a v  a 2  s  .  c om
 * 
 * @param fromSheet 
 * @param rangeAddress 
 * @param toSheet 
 * @param toRowNum 
 * @param toColumnNum 
 * @param clearFromRange 
 */
public static void copyRange(Sheet fromSheet, CellRangeAddress rangeAddress, Sheet toSheet, int toRowNum,
        int toColumnNum, boolean clearFromRange) {

    if (fromSheet == null || rangeAddress == null || toSheet == null) {
        return;
    }

    int fromRowIndex = rangeAddress.getFirstRow();
    int fromColumnIndex = rangeAddress.getFirstColumn();

    int rowNumOffset = toRowNum - fromRowIndex;
    int columnNumOffset = toColumnNum - fromColumnIndex;

    // 
    CellRangeAddress toAddress = new CellRangeAddress(rangeAddress.getFirstRow() + rowNumOffset,
            rangeAddress.getLastRow() + rowNumOffset, rangeAddress.getFirstColumn() + columnNumOffset,
            rangeAddress.getLastColumn() + columnNumOffset);

    Workbook fromWorkbook = fromSheet.getWorkbook();
    Sheet baseSheet = fromSheet;

    Sheet tmpSheet = null;
    // ?????
    if (fromSheet.equals(toSheet) && crossRangeAddress(rangeAddress, toAddress)) {
        // ?
        tmpSheet = fromWorkbook.getSheet(TMP_SHEET_NAME);
        if (tmpSheet == null) {
            tmpSheet = fromWorkbook.createSheet(TMP_SHEET_NAME);
        }
        baseSheet = tmpSheet;

        int lastColNum = getLastColNum(fromSheet);
        for (int i = 0; i <= lastColNum; i++) {
            tmpSheet.setColumnWidth(i, fromSheet.getColumnWidth(i));
        }

        copyRange(fromSheet, rangeAddress, tmpSheet, rangeAddress.getFirstRow(), rangeAddress.getFirstColumn(),
                false);

        // ?
        if (clearFromRange) {
            clearRange(fromSheet, rangeAddress);
        }
    }

    // ????
    Set<CellRangeAddress> targetCellSet = getMergedAddress(baseSheet, rangeAddress);
    // ???
    clearRange(toSheet, toAddress);

    // ???
    for (CellRangeAddress mergeAddress : targetCellSet) {

        toSheet.addMergedRegion(new CellRangeAddress(mergeAddress.getFirstRow() + rowNumOffset,
                mergeAddress.getLastRow() + rowNumOffset, mergeAddress.getFirstColumn() + columnNumOffset,
                mergeAddress.getLastColumn() + columnNumOffset));

    }

    for (int i = rangeAddress.getFirstRow(); i <= rangeAddress.getLastRow(); i++) {
        // 
        Row fromRow = baseSheet.getRow(i);
        if (fromRow == null) {
            continue;
        }
        Row row = toSheet.getRow(i + rowNumOffset);
        if (row == null) {
            row = toSheet.createRow(i + rowNumOffset);
            row.setHeight((short) 0);
        }

        // ??????
        int fromRowHeight = fromRow.getHeight();
        int toRowHeight = row.getHeight();
        if (toRowHeight < fromRowHeight) {
            row.setHeight(fromRow.getHeight());
        }

        ColumnHelper columnHelper = null;
        if (toSheet instanceof XSSFSheet) {
            XSSFSheet xssfSheet = (XSSFSheet) toSheet.getWorkbook()
                    .getSheetAt(toSheet.getWorkbook().getSheetIndex(toSheet));
            CTWorksheet ctWorksheet = xssfSheet.getCTWorksheet();
            columnHelper = new ColumnHelper(ctWorksheet);
        }

        for (int j = rangeAddress.getFirstColumn(); j <= rangeAddress.getLastColumn(); j++) {
            Cell fromCell = fromRow.getCell(j);
            if (fromCell == null) {
                continue;
            }
            int maxColumn = SpreadsheetVersion.EXCEL97.getMaxColumns();
            if (toSheet instanceof XSSFSheet) {
                maxColumn = SpreadsheetVersion.EXCEL2007.getMaxColumns();
            }
            if (j + columnNumOffset >= maxColumn) {
                break;
            }
            Cell cell = row.getCell(j + columnNumOffset);
            if (cell == null) {
                cell = row.createCell(j + columnNumOffset);
                if (toSheet instanceof XSSFSheet) {
                    // XSSF??????????
                    CTCol col = columnHelper.getColumn(cell.getColumnIndex(), false);
                    if (col == null || !col.isSetWidth()) {
                        toSheet.setColumnWidth(cell.getColumnIndex(), baseSheet.getColumnWidth(j));
                    }
                }
            }

            // ?
            copyCell(fromCell, cell);

            // ??????
            int fromColumnWidth = baseSheet.getColumnWidth(j);
            int toColumnWidth = toSheet.getColumnWidth(j + columnNumOffset);

            if (toColumnWidth < fromColumnWidth) {
                toSheet.setColumnWidth(j + columnNumOffset, baseSheet.getColumnWidth(j));
            }
        }
    }

    if (tmpSheet != null) {
        // 
        fromWorkbook.removeSheetAt(fromWorkbook.getSheetIndex(tmpSheet));
    } else if (clearFromRange) {
        // ????
        clearRange(fromSheet, rangeAddress);
    }

}

From source file:org.efaps.esjp.common.file.FileUtil_Base.java

License:Apache License

/**
 * Copy row./*from ww w  .j a  v  a2 s .  c om*/
 *
 * @param _srcSheet the src sheet
 * @param _destSheet the dest sheet
 * @param _srcRow the src row
 * @param _destRow the dest row
 * @param _styleMap the style map
 */
protected void copyRow(final Sheet _srcSheet, final Sheet _destSheet, final Row _srcRow, final Row _destRow,
        final Map<Integer, CellStyle> _styleMap) {
    final Set<CellRangeAddressWrapper> mergedRegions = new TreeSet<>();
    _destRow.setHeight(_srcRow.getHeight());
    final int deltaRows = _destRow.getRowNum() - _srcRow.getRowNum();
    for (int j = _srcRow.getFirstCellNum(); j <= _srcRow.getLastCellNum(); j++) {
        final Cell oldCell = _srcRow.getCell(j); // ancienne cell
        Cell newCell = _destRow.getCell(j); // new cell
        if (oldCell != null) {
            if (newCell == null) {
                newCell = _destRow.createCell(j);
            }
            copyCell(oldCell, newCell, _styleMap);
            final CellRangeAddress mergedRegion = getMergedRegion(_srcSheet, _srcRow.getRowNum(),
                    (short) oldCell.getColumnIndex());

            if (mergedRegion != null) {
                final CellRangeAddress newMergedRegion = new CellRangeAddress(
                        mergedRegion.getFirstRow() + deltaRows, mergedRegion.getLastRow() + deltaRows,
                        mergedRegion.getFirstColumn(), mergedRegion.getLastColumn());
                final CellRangeAddressWrapper wrapper = new CellRangeAddressWrapper(newMergedRegion);
                if (isNewMergedRegion(wrapper, mergedRegions)) {
                    mergedRegions.add(wrapper);
                    _destSheet.addMergedRegion(wrapper.range);
                }
            }
        }
    }
}

From source file:org.forzaframework.util.ExcelUtils.java

License:Apache License

public static void setRowHeight(Sheet sheet, Integer row, Short height) {
    Row headerRow = sheet.getRow(row);
    if (headerRow != null) {
        headerRow.setHeight(height);
    }/* w w  w  .  j  a v a 2s  .  c o m*/
}

From source file:org.hellojavaer.poi.excel.utils.ExcelUtils.java

License:Apache License

@SuppressWarnings("unchecked")
private static void write(boolean useTemplate, Workbook workbook, OutputStream outputStream,
        ExcelWriteSheetProcessor<?>... sheetProcessors) {

    for (@SuppressWarnings("rawtypes")
    ExcelWriteSheetProcessor sheetProcessor : sheetProcessors) {
        @SuppressWarnings("rawtypes")
        ExcelWriteContext context = new ExcelWriteContext();

        try {//from   w w w  .j  a  v  a  2  s  . c o m
            if (sheetProcessor == null) {
                continue;
            }
            String sheetName = sheetProcessor.getSheetName();
            Integer sheetIndex = sheetProcessor.getSheetIndex();
            Sheet sheet = null;
            if (sheetProcessor.getTemplateStartRowIndex() == null
                    && sheetProcessor.getTemplateEndRowIndex() == null) {
                sheetProcessor.setTemplateRows(sheetProcessor.getStartRowIndex(),
                        sheetProcessor.getStartRowIndex());
            }
            // sheetName priority,
            if (useTemplate) {
                if (sheetName != null) {
                    try {
                        sheet = workbook.getSheet(sheetName);
                    } catch (IllegalArgumentException e) {
                        // ignore
                    }
                    if (sheet != null && sheetIndex != null
                            && !sheetIndex.equals(workbook.getSheetIndex(sheet))) {
                        throw new IllegalArgumentException(
                                "sheetName[" + sheetName + "] and sheetIndex[" + sheetIndex + "] not match.");
                    }
                } else if (sheetIndex != null) {
                    try {
                        sheet = workbook.getSheetAt(sheetIndex);
                    } catch (IllegalArgumentException e) {
                        // ignore
                    }
                } else {
                    throw new IllegalArgumentException("sheetName or sheetIndex can't be null");
                }
                if (sheet == null) {
                    ExcelWriteException e = new ExcelWriteException(
                            "Sheet Not Found Exception. for sheet name:" + sheetName);
                    e.setCode(ExcelWriteException.CODE_OF_SHEET_NOT_EXSIT);
                    throw e;
                }
            } else {
                if (sheetName != null) {
                    sheet = workbook.getSheet(sheetName);
                    if (sheet != null) {
                        if (sheetIndex != null && !sheetIndex.equals(workbook.getSheetIndex(sheet))) {
                            throw new IllegalArgumentException("sheetName[" + sheetName + "] and sheetIndex["
                                    + sheetIndex + "] not match.");
                        }
                    } else {
                        sheet = workbook.createSheet(sheetName);
                        if (sheetIndex != null) {
                            workbook.setSheetOrder(sheetName, sheetIndex);
                        }
                    }
                } else if (sheetIndex != null) {
                    sheet = workbook.createSheet();
                    workbook.setSheetOrder(sheet.getSheetName(), sheetIndex);
                } else {
                    throw new IllegalArgumentException("sheetName or sheetIndex can't be null");
                }
            }

            if (sheetIndex == null) {
                sheetIndex = workbook.getSheetIndex(sheet);
            }
            if (sheetName == null) {
                sheetName = sheet.getSheetName();
            }

            // proc sheet
            context.setCurSheet(sheet);
            context.setCurSheetIndex(sheetIndex);
            context.setCurSheetName(sheet.getSheetName());
            context.setCurRow(null);
            context.setCurRowIndex(null);
            context.setCurCell(null);
            context.setCurColIndex(null);
            // beforeProcess
            sheetProcessor.beforeProcess(context);
            // write head
            writeHead(useTemplate, sheet, sheetProcessor);
            // sheet
            ExcelProcessControllerImpl controller = new ExcelProcessControllerImpl();
            int writeRowIndex = sheetProcessor.getStartRowIndex();
            boolean isBreak = false;
            Map<Integer, InnerRow> cacheForTemplateRow = new HashMap<Integer, InnerRow>();

            List<?> dataList = sheetProcessor.getDataList(); //
            if (dataList != null && !dataList.isEmpty()) {
                for (Object rowData : dataList) {
                    // proc row
                    Row row = sheet.getRow(writeRowIndex);
                    if (row == null) {
                        row = sheet.createRow(writeRowIndex);
                    }
                    InnerRow templateRow = getTemplateRow(cacheForTemplateRow, sheet, sheetProcessor,
                            writeRowIndex);
                    if (templateRow != null) {
                        row.setHeight(templateRow.getHeight());
                        row.setHeightInPoints(templateRow.getHeightInPoints());
                        row.setRowStyle(templateRow.getRowStyle());
                        row.setZeroHeight(templateRow.isZeroHeight());
                    }
                    context.setCurRow(row);
                    context.setCurRowIndex(writeRowIndex);
                    context.setCurColIndex(null);
                    context.setCurCell(null);
                    //
                    try {
                        controller.reset();
                        if (sheetProcessor.getRowProcessor() != null) {
                            sheetProcessor.getRowProcessor().process(controller, context, rowData, row);
                        }
                        if (!controller.isDoSkip()) {
                            writeRow(context, templateRow, row, rowData, sheetProcessor);
                            writeRowIndex++;
                        }
                        if (controller.isDoBreak()) {
                            isBreak = true;
                            break;
                        }
                    } catch (RuntimeException e) {
                        if (e instanceof ExcelWriteException) {
                            ExcelWriteException ewe = (ExcelWriteException) e;
                            // ef.setColIndex(null); user may want to set this value,
                            ewe.setRowIndex(writeRowIndex);
                            throw ewe;
                        } else {
                            ExcelWriteException ewe = new ExcelWriteException(e);
                            ewe.setColIndex(null);
                            ewe.setCode(ExcelWriteException.CODE_OF_PROCESS_EXCEPTION);
                            ewe.setRowIndex(writeRowIndex);
                            throw ewe;
                        }
                    }
                }
                if (isBreak) {
                    break;
                }
            }
            if (sheetProcessor.getTemplateStartRowIndex() != null
                    && sheetProcessor.getTemplateEndRowIndex() != null) {
                writeDataValidations(sheet, sheetProcessor);
                writeStyleAfterFinish(useTemplate, sheet, sheetProcessor);
            }
        } catch (RuntimeException e) {
            sheetProcessor.onException(context, e);
        } finally {
            sheetProcessor.afterProcess(context);
        }
    }

    try {
        workbook.write(outputStream);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

From source file:org.joeffice.spreadsheet.SheetComponent.java

License:Apache License

public void listenToChanges() {
    sheetTable.getModel().addTableModelListener(new TableModelListener() {

        @Override/*www  .  ja  v a2  s. c  om*/
        public void tableChanged(TableModelEvent e) {
            getSpreadsheetComponent().setModified(true);
        }
    });
    sheetTable.addPropertyChangeListener("singleRowHeight", new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            int rowChanged = (Integer) evt.getNewValue();
            int newHeight = sheetTable.getRowHeight(rowChanged);
            if (newHeight != sheetTable.getRowHeight(rowChanged)) {
                Row row = sheet.getRow(rowChanged);
                if (row == null) {
                    row = sheet.createRow(rowChanged);
                }
                row.setHeight((short) newHeight);
            }
        }
    });
}

From source file:org.kuali.test.runner.output.PoiHelper.java

License:Educational Community License

private Row writeBaseEntryInformation(TestOperation op, Date startTime) {
    Row retval = wb.getSheetAt(0).createRow(++currentReportRow);

    // operation number
    Cell cell = retval.createCell(0);//from www  .j av  a  2 s  .  co  m
    cell.setCellValue(op.getOperation().getIndex());
    cell.setCellStyle(cellStyleNormal);

    // checkpoint name
    cell = retval.createCell(1);
    cell.setCellValue(getOperationNameForOutput(op));
    cell.setCellStyle(cellStyleNormal);

    // checkpoint type
    cell = retval.createCell(2);
    cell.setCellValue(getOperationTypeForOutput(op));
    cell.setCellStyle(cellStyleNormal);

    // group
    cell = retval.createCell(3);
    cell.setCellStyle(cellStyleNormal);
    if (op.getOperationType().equals(TestOperationType.CHECKPOINT)) {
        int lines = op.getOperation().getCheckpointOperation().getCheckpointProperties()
                .sizeOfCheckpointPropertyArray();
        if (lines > 1) {
            retval.setHeight((short) (lines * retval.getHeight()));
        }

        StringBuilder s = new StringBuilder(128);
        for (CheckpointProperty cp : op.getOperation().getCheckpointOperation().getCheckpointProperties()
                .getCheckpointPropertyArray()) {
            if (StringUtils.isNotBlank(cp.getPropertyGroup())) {
                s.append(cp.getPropertyGroup());
                s.append("\n");
            }
        }
        cell.setCellValue(s.toString());
    } else {
        cell.setCellValue("");
    }

    // section
    cell = retval.createCell(4);
    cell.setCellStyle(cellStyleNormal);
    if (op.getOperationType().equals(TestOperationType.CHECKPOINT)) {
        StringBuilder s = new StringBuilder(128);
        for (CheckpointProperty cp : op.getOperation().getCheckpointOperation().getCheckpointProperties()
                .getCheckpointPropertyArray()) {
            if (StringUtils.isNotBlank(cp.getPropertySection())) {
                s.append(cp.getPropertySection().replaceAll(Constants.TAG_MATCH_REGEX_PATTERN, "").trim());
            }
            s.append("\n");
        }
        cell.setCellValue(s.toString());
    } else {
        cell.setCellValue("");
    }

    // start time
    cell = retval.createCell(5);
    cell.setCellValue(startTime);
    cell.setCellStyle(cellStyleTime);

    // endTime time
    long endts = System.currentTimeMillis();

    cell = retval.createCell(6);
    cell.setCellValue(new Date(endts));
    cell.setCellStyle(cellStyleTime);

    // run time
    cell = retval.createCell(7);
    cell.setCellValue((endts - startTime.getTime()) / 1000);
    cell.setCellStyle(cellStyleNormal);

    // expected values
    cell = retval.createCell(8);
    cell.setCellStyle(cellStyleNormal);
    if (op.getOperationType().equals(TestOperationType.CHECKPOINT)) {
        StringBuilder s = new StringBuilder(128);
        for (CheckpointProperty cp : op.getOperation().getCheckpointOperation().getCheckpointProperties()
                .getCheckpointPropertyArray()) {
            if (StringUtils.isNotBlank(cp.getDisplayName())) {
                s.append(cp.getDisplayName());
                s.append(" ");
                s.append(Utils.getOperatorFromEnumName(cp.getOperator()));
                if (!ComparisonOperator.NOT_NULL.equals(cp.getOperator())
                        && !ComparisonOperator.NULL.equals(cp.getOperator())) {
                    s.append(" ");
                    s.append(cp.getPropertyValue());
                    s.append("\n");
                }
            }
        }
        cell.setCellValue(s.toString());
    } else {
        cell.setCellValue("");
    }

    // actual values
    cell = retval.createCell(9);
    cell.setCellStyle(cellStyleNormal);
    if (op.getOperationType().equals(TestOperationType.CHECKPOINT)) {
        StringBuilder s = new StringBuilder(128);
        for (CheckpointProperty cp : op.getOperation().getCheckpointOperation().getCheckpointProperties()
                .getCheckpointPropertyArray()) {
            if (StringUtils.isNotBlank(cp.getDisplayName())) {
                s.append(cp.getDisplayName());
                s.append(" = ");
                s.append(cp.getActualValue());
                s.append("\n");
            }
        }
        cell.setCellValue(s.toString());

    } else {
        cell.setCellValue("");
    }

    return retval;
}