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

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

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

HSSFWorkbook.setActiveSheet介绍

[英]Convenience method to set the active sheet. The active sheet is is the sheet which is currently displayed when the workbook is viewed in Excel. 'Selected' sheet(s) is a distinct concept.
[中]

代码示例

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

private void updateActiveSheetAfterSheetReorder(int oldIndex, int newIndex) {
  // adjust active sheet if necessary
  int active = getActiveSheetIndex();
  if(active == oldIndex) {
    // moved sheet was the active one
    setActiveSheet(newIndex);
  } else if ((active < oldIndex && active < newIndex) ||
      (active > oldIndex && active > newIndex)) {
    // not affected
  } else if (newIndex > oldIndex) {
    // moved sheet was below before and is above now => active is one less
    setActiveSheet(active-1);
  } else {
    // remaining case: moved sheet was higher than active before and is lower now => active is one more
    setActiveSheet(active+1);
  }
}

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

if(active == index) {
  setActiveSheet(newSheetIndex);
} else if (active > index) {
  setActiveSheet(active-1);

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

private void updateActiveSheetAfterSheetReorder(int oldIndex, int newIndex) {
  // adjust active sheet if necessary
  int active = getActiveSheetIndex();
  if(active == oldIndex) {
    // moved sheet was the active one
    setActiveSheet(newIndex);
  } else if ((active < oldIndex && active < newIndex) ||
      (active > oldIndex && active > newIndex)) {
    // not affected
  } else if (newIndex > oldIndex) {
    // moved sheet was below before and is above now => active is one less
    setActiveSheet(active-1);
  } else {
    // remaining case: moved sheet was higher than active before and is lower now => active is one more
    setActiveSheet(active+1);
  }
}

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

HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(file));
 HSSFSheet s = wb.getSheetAt(0);
 wb.setActiveSheet(0);
 s.showInPane(0, 0);
 FileOutputStream out = new FileOutputStream(file);
 wb.write(out);
 out.close();

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

wb.setActiveSheet(0);
BufferedImage img = null;
try {

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

if(active == index) {
  setActiveSheet(newSheetIndex);
} else if (active > index) {
  setActiveSheet(active-1);

代码示例来源:origin: com.haulmont.thirdparty/poi

setActiveSheet(newSheetIndex);

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

setActiveSheet(newSheetIndex);

相关文章

HSSFWorkbook类方法