Exemplo n.º 1
0
  public void body(TableModel model, Column column) {
    if (column.isFirstColumn()) {
      rownum++;
      cellnum = 0;
      hssfRow = sheet.createRow(rownum);
    }
    String value = column.getCellDisplay();
    if (StringUtils.isNumeric(value)) {
      value = column.getValue() == null ? "" : column.getValue().toString();
    }
    value = value.replaceAll("\t", "").replaceAll("\n", "");
    value = ExportViewUtils.parseXLS(value);

    HSSFCell hssfCell = hssfRow.createCell(cellnum);

    // modify by springside
    // hssfCell.setEncoding(HSSFCell.ENCODING_UTF_16);
    // end of modify by springside

    if (column.isEscapeAutoFormat()) {
      writeToCellAsText(hssfCell, value);
    } else {
      writeToCellFormatted(hssfCell, value);
    }
    cellnum++;
  }
Exemplo n.º 2
0
 protected String getCellValue(TableModel tableModel, Column column) {
   if (column.getValue() == null) return "Invalid Entry";
   else {
     if (column.getValue() instanceof Integer) {
       Integer stratumGroupNumber = (Integer) column.getValue();
       if (stratumGroupNumber < 0) {
         return "Invalid Entry";
       }
     }
   }
   return column.getValueAsString();
 }