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

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

本文整理了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

  1. @Override
  2. public void accept(final CellStyle style) {
  3. style.setQuotePrefixed(this.value);
  4. }
  5. }

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

  1. @Override
  2. public void anyProperty(PropertyName name, Context context) {
  3. Cell cell = context.nextCell();
  4. Object value = context.getValue(name);
  5. if (value != null) {
  6. cell.setCellValue(value.toString());
  7. cell.getCellStyle().setQuotePrefixed(true);
  8. }
  9. }
  10. }

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

  1. @Override
  2. public void stringProperty(PropertyName name, Context context) {
  3. Cell cell = context.nextCell();
  4. String value = (String) context.getValue(name);
  5. if (value != null) {
  6. cell.setCellValue(value);
  7. cell.getCellStyle().setQuotePrefixed(true);
  8. }
  9. }

相关文章