org.apache.poi.ss.usermodel.CellStyle.setQuotePrefixed()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(334)

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

CellStyle.setQuotePrefixed介绍

[英]Turn on or off "Quote Prefix" or "123 Prefix" for the style, which is used to tell Excel that the thing which looks like a number or a formula shouldn't be treated as on. Turning this on is somewhat (but not completely, see IgnoredErrorType) like prefixing the cell value with a ' in Excel
[中]打开或关闭样式的“Quote Prefix”或“123 Prefix”,用于告诉Excel看起来像数字或公式的内容不应视为打开。启用此选项在某种程度上(但并非完全如此,请参见IgnoreErrorType)类似于在Excel中为单元格值加上“前缀”

代码示例

代码示例来源:origin: Vatavuk/excel-io

@Override
  public void accept(final CellStyle style) {
    style.setQuotePrefixed(this.value);
  }
}

代码示例来源:origin: asakusafw/asakusafw

@Override
  public void anyProperty(PropertyName name, Context context) {
    Cell cell = context.nextCell();
    Object value = context.getValue(name);
    if (value != null) {
      cell.setCellValue(value.toString());
      cell.getCellStyle().setQuotePrefixed(true);
    }
  }
}

代码示例来源:origin: asakusafw/asakusafw

@Override
public void stringProperty(PropertyName name, Context context) {
  Cell cell = context.nextCell();
  String value = (String) context.getValue(name);
  if (value != null) {
    cell.setCellValue(value);
    cell.getCellStyle().setQuotePrefixed(true);
  }
}

相关文章

微信公众号

最新文章

更多