Examples of cloneStyleFrom()


Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

      if(cell.getCellType() != Cell.CELL_TYPE_NUMERIC)
        cell.setCellType(Cell.CELL_TYPE_NUMERIC);
      if(!DateUtil.isCellDateFormatted(cell)){
        CellStyle style = cell.getSheet().getWorkbook().createCellStyle();
        if(cell.getCellStyle() == null){
          style.cloneStyleFrom(cell.getCellStyle());
        }
        style.setDataFormat(
            cell.getSheet().getWorkbook().getCreationHelper().createDataFormat()
              .getFormat(LoxiaSupportSettings.getInstance().
                  get(LoxiaSupportConstants.DATE_PATTERN))
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

        {
            writeColumnOpener(null);
            Object columnValue = (cell.isTotaled()) ? tt.getTotalForColumn(cell.getColumnNumber(), 0) : null;
            writeCellValue(columnValue);
            CellStyle st = utils.getNewCellStyle();
            st.cloneStyleFrom(currentCell.getCellStyle());
            st.setBorderTop(CellStyle.BORDER_THIN);
            st.setTopBorderColor(IndexedColors.BLACK.getIndex());
            currentCell.setCellStyle(st);
            writeColumnCloser(null);
        }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

        int stHashCode = oldCell.getCellStyle().hashCode();
        CellStyle newCellStyle = styleMap.get(stHashCode);
        if (newCellStyle == null) {
          newCellStyle = newCell.getSheet().getWorkbook()
              .createCellStyle();
          newCellStyle.cloneStyleFrom(oldCell.getCellStyle());
          styleMap.put(stHashCode, newCellStyle);
        }
        newCell.setCellStyle(newCellStyle);
      }
    }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

 
    Iterator it = dataStore.iterator();
      int rownum = beginRowData;
      short formatIndexInt = HSSFDataFormat.getBuiltinFormat("#,##0");
      CellStyle cellStyleInt = wb.createCellStyle(); // cellStyleInt is the default cell style for integers
      cellStyleInt.cloneStyleFrom(dCellStyle);
      cellStyleInt.setDataFormat(formatIndexInt);
     
      short formatIndexDoub = HSSFDataFormat.getBuiltinFormat("#,##0.00");
      CellStyle cellStyleDoub = wb.createCellStyle(); // cellStyleDoub is the default cell style for doubles
      cellStyleDoub.cloneStyleFrom(dCellStyle);
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

      cellStyleInt.cloneStyleFrom(dCellStyle);
      cellStyleInt.setDataFormat(formatIndexInt);
     
      short formatIndexDoub = HSSFDataFormat.getBuiltinFormat("#,##0.00");
      CellStyle cellStyleDoub = wb.createCellStyle(); // cellStyleDoub is the default cell style for doubles
      cellStyleDoub.cloneStyleFrom(dCellStyle);
      cellStyleDoub.setDataFormat(formatIndexDoub);
     
    CellStyle cellStyleDate = wb.createCellStyle(); // cellStyleDate is the default cell style for dates
    cellStyleDate.cloneStyleFrom(dCellStyle);
    cellStyleDate.setDataFormat(createHelper.createDataFormat().getFormat("m/d/yy"));
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

      CellStyle cellStyleDoub = wb.createCellStyle(); // cellStyleDoub is the default cell style for doubles
      cellStyleDoub.cloneStyleFrom(dCellStyle);
      cellStyleDoub.setDataFormat(formatIndexDoub);
     
    CellStyle cellStyleDate = wb.createCellStyle(); // cellStyleDate is the default cell style for dates
    cellStyleDate.cloneStyleFrom(dCellStyle);
    cellStyleDate.setDataFormat(createHelper.createDataFormat().getFormat("m/d/yy"));
   
    IDataStoreMetaData d = dataStore.getMetaData()
   
    while(it.hasNext()){
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

    }

    @Override
    public CellStyle create(Workbook workbook) {
        CellStyle style = workbook.createCellStyle();
        style.cloneStyleFrom(source.getCellStyle());
        return style;
    }
}
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

            // Grab a copy of the old/new cell
            Cell newCell = newRow.createCell(oldCell.getColumnIndex());

            // Copy style from old cell and apply to new cell
            CellStyle newCellStyle = workbook.createCellStyle();
            newCellStyle.cloneStyleFrom(oldCell.getCellStyle());
            newCell.setCellStyle(newCellStyle);

            // If there is a cell comment, copy
            if (oldCell.getCellComment() != null) {
                newCell.setCellComment(oldCell.getCellComment());
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

    dataFont.setFontHeightInPoints((short) 10);
    style.setFont(dataFont);
    styles.put("data", style);
   
    style = wb.createCellStyle();
    style.cloneStyleFrom(styles.get("data"));
    style.setAlignment(CellStyle.ALIGN_LEFT);
    styles.put("data1", style);

    style = wb.createCellStyle();
    style.cloneStyleFrom(styles.get("data"));
View Full Code Here

Examples of org.apache.poi.ss.usermodel.CellStyle.cloneStyleFrom()

    style.cloneStyleFrom(styles.get("data"));
    style.setAlignment(CellStyle.ALIGN_LEFT);
    styles.put("data1", style);

    style = wb.createCellStyle();
    style.cloneStyleFrom(styles.get("data"));
    style.setAlignment(CellStyle.ALIGN_CENTER);
    styles.put("data2", style);

    style = wb.createCellStyle();
    style.cloneStyleFrom(styles.get("data"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.