gpt4 book ai didi

org.apache.poi.xssf.usermodel.XSSFTable.updateHeaders()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 05:02:40 26 4
gpt4 key购买 nike

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

XSSFTable.updateHeaders介绍

[英]Synchronize table headers with cell values in the parent sheet. Headers must be in sync, otherwise Excel will display a "Found unreadable content" message on startup. If calling both #updateReferences() and this method, #updateReferences()should be called first. Note that a Table must have a header. To reproduce the equivalent of inserting a table in Excel without Headers, manually add cells with values of "Column1", "Column2" etc first.
[中]将表格标题与父工作表中的单元格值同步。标题必须同步,否则Excel将在启动时显示“查找不可读内容”消息。如果同时调用#updateReferences()和此方法,则应首先调用#updateReferences()。请注意,表必须有一个标题。要复制在Excel中插入不带标题的表格的等效方法,请先手动添加值为“Column1”、“Column2”等的单元格。

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * write table XML to an {@link OutputStream}
 * @param out The stream to write the XML data to
 * @throws IOException If writing to the stream fails.
 */
public void writeTo(OutputStream out) throws IOException {
  updateHeaders();
  TableDocument doc = TableDocument.Factory.newInstance();
  doc.setTable(ctTable);
  doc.save(out, DEFAULT_XML_OPTIONS);
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Remove a column from the table.
 *
 * @param column
 *            the column to remove
 * @since 4.0.0
 */
public void removeColumn(XSSFTableColumn column) {
  int columnIndex = getColumns().indexOf(column);
  if (columnIndex >= 0) {
    ctTable.getTableColumns().removeTableColumn(columnIndex);
    updateReferences();
    updateHeaders();
  }
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Remove a column from the table.
 *
 * @param columnIndex
 *            the 0-based position of the column in the table
 * @throws IllegalArgumentException
 *             if no column at the index exists or if the table has only a
 *             single column
 * @since 4.0.0
 */
public void removeColumn(int columnIndex) {
  if (columnIndex < 0 || columnIndex > getColumnCount() - 1) {
    throw new IllegalArgumentException("Column index out of bounds");
  }
  
  if(getColumnCount() == 1) {
    throw new IllegalArgumentException("Table must have at least one column");
  }
  
  CTTableColumns tableColumns = ctTable.getTableColumns();
  tableColumns.removeTableColumn(columnIndex);
  tableColumns.setCount(tableColumns.getTableColumnList().size());
  updateReferences();
  updateHeaders();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

updateHeaders();

代码示例来源:origin: org.apache.poi/poi-ooxml

updateHeaders();

代码示例来源:origin: org.apache.poi/poi-ooxml

updateHeaders();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * write table XML to an {@link OutputStream}
 * @param out The stream to write the XML data to
 * @throws IOException If writing to the stream fails.
 */
public void writeTo(OutputStream out) throws IOException {
  updateHeaders();
  TableDocument doc = TableDocument.Factory.newInstance();
  doc.setTable(ctTable);
  doc.save(out, DEFAULT_XML_OPTIONS);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Remove a column from the table.
 *
 * @param column
 *            the column to remove
 * @since 4.0.0
 */
public void removeColumn(XSSFTableColumn column) {
  int columnIndex = getColumns().indexOf(column);
  if (columnIndex >= 0) {
    ctTable.getTableColumns().removeTableColumn(columnIndex);
    updateReferences();
    updateHeaders();
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Remove a column from the table.
 *
 * @param columnIndex
 *            the 0-based position of the column in the table
 * @throws IllegalArgumentException
 *             if no column at the index exists or if the table has only a
 *             single column
 * @since 4.0.0
 */
public void removeColumn(int columnIndex) {
  if (columnIndex < 0 || columnIndex > getColumnCount() - 1) {
    throw new IllegalArgumentException("Column index out of bounds");
  }
  
  if(getColumnCount() == 1) {
    throw new IllegalArgumentException("Table must have at least one column");
  }
  
  CTTableColumns tableColumns = ctTable.getTableColumns();
  tableColumns.removeTableColumn(columnIndex);
  tableColumns.setCount(tableColumns.getTableColumnList().size());
  updateReferences();
  updateHeaders();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

updateHeaders();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

updateHeaders();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

updateHeaders();

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