org.apache.poi.hssf.usermodel.HSSFWorkbook.setSheetName()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(134)

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

HSSFWorkbook.setSheetName介绍

[英]Set the sheet name.
[中]设置图纸名称。

代码示例

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-ext

private HSSFSheet addSheet(String sheetName) {
  currentColumnIndex = -1;
  currentRowIndex = -1;
  currentSheet++;
  // create sheet
  HSSFSheet sheet = workbook.createSheet();
  // sheet name
  workbook.setSheetName(currentSheet, sheetName,
      HSSFWorkbook.ENCODING_UTF_16);
  return sheet;
}

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

public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
   if (newSheetName != null) {
    wb.setSheetName(tabIndex, newSheetName);
    sheetPane.setTitleAt(tabIndex, newSheetName);
   }
  }
 }
}

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

@Override
 public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
   if (newSheetName != null) {
    wb.setSheetName(tabIndex, newSheetName);
    sheetPane.setTitleAt(tabIndex, newSheetName);
   }
  }
 }
}

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

public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   String newSheetName = JOptionPane.showInputDialog(sheetPane, "Enter a new Sheetname", "Rename Sheet", JOptionPane.QUESTION_MESSAGE);
   if (newSheetName != null) {
    wb.setSheetName(tabIndex, newSheetName);
    sheetPane.setTitleAt(tabIndex, newSheetName);
   }
  }
 }
}

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

public static void main(String[] args) throws IOException {
    try (HSSFWorkbook wb = new HSSFWorkbook()) {
      wb.createSheet("new sheet");
      // create with default name
      wb.createSheet();
      final String name = "second sheet";
      // setting sheet name later
      wb.setSheetName(1, WorkbookUtil.createSafeSheetName(name));

      try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
        wb.write(fileOut);
      }
    }
  }
}

代码示例来源:origin: QihooTest/Leo

workbook.setSheetName(index, metaData.getTableName());

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

cs2.setFillForegroundColor((short) 0xA);
cs2.setFont(f2);
wb.setSheetName(0, "HSSF Test");
int rownum;
for (rownum = 0; rownum < 300; rownum++) {
wb.setSheetName(1, "DeletedSheet");
wb.removeSheetAt(1);

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

wb.setSheetName(0, "HSSF Test");
wb.setSheetName(1, "DeletedSheet");
wb.removeSheetAt(1);

代码示例来源:origin: stackoverflow.com

wb.setSheetName(0, this.getCustomer().getClass().getSimpleName());
HSSFSheet sheet = wb.getSheetAt(0);

相关文章

HSSFWorkbook类方法