gpt4 book ai didi

jxl.write.WritableCell.setCellFormat()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 07:09:05 28 4
gpt4 key购买 nike

本文整理了Java中jxl.write.WritableCell.setCellFormat()方法的一些代码示例,展示了WritableCell.setCellFormat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableCell.setCellFormat()方法的具体详情如下:
包路径:jxl.write.WritableCell
类名称:WritableCell
方法名:setCellFormat

WritableCell.setCellFormat介绍

[英]Sets the cell format for this cell
[中]设置此单元格的单元格格式

代码示例

代码示例来源:origin: org.jxls/jxls-jexcel

private void updateCellStyle(WritableCell cell) {
//        WritableCellFormat writableCellFormat = new WritableCellFormat(cellFormat);
//        cell.setCellFormat(writableCellFormat);
    cell.setCellFormat(cellFormat);
  }

代码示例来源:origin: org.icefaces/icefaces-compat

cell.setCellFormat(format);

代码示例来源:origin: org.jxls/jxls-jexcel

public WritableCell writeToCell(WritableSheet sheet, int col, int row, Context context) throws WriteException {
  WritableHyperlink hyperlink = null;
  if( url != null ){
    if( description != null ){
      hyperlink = new WritableHyperlink(col, row, col, row, url, description);
    }else{
      hyperlink = new WritableHyperlink(col, row, url);
    }
  }
  if( file != null ){
    if( description != null ){
      hyperlink = new WritableHyperlink(col, row, file, description);
    }else{
      hyperlink = new WritableHyperlink(col, row, file);
    }
  }
  sheet.addHyperlink(hyperlink);
  Cell cell = sheet.getCell(col, row);
  WritableCell writableCell = new Label(col, row, description != null ? description : url.toString());
  if( cell != null && cell.getCellFormat() != null ){
    writableCell.setCellFormat( cell.getCellFormat() );
  }
  sheet.addCell(writableCell);
  return writableCell;
}

代码示例来源:origin: org.jxls/jxls-jexcel

public void setFormula(CellRef cellRef, String formulaString) {
  if (cellRef == null || cellRef.getSheetName() == null) return;
  WritableSheet sheet = writableWorkbook.getSheet(cellRef.getSheetName());
  if (sheet == null) {
    int numberOfSheets = writableWorkbook.getNumberOfSheets();
    sheet = writableWorkbook.createSheet(cellRef.getSheetName(), numberOfSheets);
  }
  Cell cell = sheet.getCell(cellRef.getCol(), cellRef.getRow());
  WritableCell writableCell = new Formula(cellRef.getCol(), cellRef.getRow(), formulaString);
  if (cell != null && cell.getCellFormat() != null) {
    writableCell.setCellFormat(cell.getCellFormat());
  }
  try {
    sheet.addCell(writableCell);
  } catch (Exception e) {
    logger.error("Failed to set formula = " + formulaString + " into cell = " + cellRef.getCellName(), e);
  }
}

代码示例来源:origin: davidpelfree/sjxlsx

c.setCellFormat(newFormat);

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

c.setCellFormat(wcf);

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

c.setCellFormat(wcf);

代码示例来源:origin: com.hynnet/jxl

c.setCellFormat(wcf);

代码示例来源:origin: com.hynnet/jxl

c.setCellFormat(wcf);

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

WritableFont.BOLD);
cf = new WritableCellFormat(bold);
cell.setCellFormat(cf);
                     UnderlineStyle.SINGLE);
cf = new WritableCellFormat(underline);
cell.setCellFormat(cf);
WritableFont tenpoint = new WritableFont(WritableFont.ARIAL, 10);
cf = new WritableCellFormat(tenpoint);
cell.setCellFormat(cf);
NumberFormat sevendps = new NumberFormat("#.0000000");
cf = new WritableCellFormat(sevendps);
cell.setCellFormat(cf);
NumberFormat exp4 = new NumberFormat("0.####E0");
cf = new WritableCellFormat(exp4);
cell.setCellFormat(cf);
cell.setCellFormat(WritableWorkbook.NORMAL_STYLE);
DateFormat df = new DateFormat("dd MMM yyyy HH:mm:ss");
cf = new WritableCellFormat(df);
cell.setCellFormat(cf);
cell.setCellFormat(cf);
WritableCellFormat newFormat = new WritableCellFormat(c.getCellFormat());

代码示例来源:origin: com.hynnet/jxl

WritableFont.BOLD);
cf = new WritableCellFormat(bold);
cell.setCellFormat(cf);
                     UnderlineStyle.SINGLE);
cf = new WritableCellFormat(underline);
cell.setCellFormat(cf);
WritableFont tenpoint = new WritableFont(WritableFont.ARIAL, 10);
cf = new WritableCellFormat(tenpoint);
cell.setCellFormat(cf);
NumberFormat sevendps = new NumberFormat("#.0000000");
cf = new WritableCellFormat(sevendps);
cell.setCellFormat(cf);
NumberFormat exp4 = new NumberFormat("0.####E0");
cf = new WritableCellFormat(exp4);
cell.setCellFormat(cf);
cell.setCellFormat(WritableWorkbook.NORMAL_STYLE);
DateFormat df = new DateFormat("dd MMM yyyy HH:mm:ss");
cf = new WritableCellFormat(df);
cell.setCellFormat(cf);
cell.setCellFormat(cf);
WritableCellFormat newFormat = new WritableCellFormat(c.getCellFormat());

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

( (WritableCell) topLeft).setCellFormat(cf1);

代码示例来源:origin: com.hynnet/jxl

( (WritableCell) topLeft).setCellFormat(cf1);

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

((WritableCell) cells[i]).setCellFormat(xfr);

代码示例来源:origin: com.hynnet/jxl

((WritableCell) cells[i]).setCellFormat(xfr);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com