org.apache.poi.openxml4j.exceptions.InvalidFormatException.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(97)

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

InvalidFormatException.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: wzhe06/ipdatabase

public static Workbook getWorkbook(String filePath){
  try {
    return WorkbookFactory.create(new FileInputStream(filePath));
  } catch (IOException e) {
    e.printStackTrace();
  } catch (InvalidFormatException e) {
    e.printStackTrace();
  }
  return null;
}

代码示例来源:origin: zhangdaiscott/jeasypoi

/**
 * 读取excel数据
 * @param path
 */
public static ArrayList<Map<String,String>> readExcelToObj(String path) {
  Workbook wb = null;
  ArrayList<Map<String,String>> result = null;
  try {
    wb = WorkbookFactory.create(new File(path));
    result = readExcel(wb, 0, 2, 0);
  } catch (InvalidFormatException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
  return result;
}

代码示例来源:origin: caryyu/excel2pdf

public Excel(InputStream is) {
  try {
    this.wb = WorkbookFactory.create(is);
    this.sheet = wb.getSheetAt(wb.getActiveSheetIndex());
  } catch (FileNotFoundException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  } catch (InvalidFormatException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: hmkcode/Java

wb = WorkbookFactory.create(new File("workbook.xlsx"));
} catch (InvalidFormatException e) {
  e.printStackTrace();
} catch (IOException e) {
  e.printStackTrace();

代码示例来源:origin: naveenanimation20/PageObjectModel

public static Object[][] getTestData(String sheetName) {
  FileInputStream file = null;
  try {
    file = new FileInputStream(TESTDATA_SHEET_PATH);
  } catch (FileNotFoundException e) {
    e.printStackTrace();
  }
  try {
    book = WorkbookFactory.create(file);
  } catch (InvalidFormatException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
  sheet = book.getSheet(sheetName);
  Object[][] data = new Object[sheet.getLastRowNum()][sheet.getRow(0).getLastCellNum()];
  // System.out.println(sheet.getLastRowNum() + "--------" +
  // sheet.getRow(0).getLastCellNum());
  for (int i = 0; i < sheet.getLastRowNum(); i++) {
    for (int k = 0; k < sheet.getRow(0).getLastCellNum(); k++) {
      data[i][k] = sheet.getRow(i + 1).getCell(k).toString();
      // System.out.println(data[i][k]);
    }
  }
  return data;
}

代码示例来源:origin: com.github.mg365/mg-common

/**
 * 根据模板生成Excel文件.
 *
 * @param templateFileName
 * @param beanParams
 * @param resultFileName
 */
public String createExcel(String templateFileName, Map<String, Object> beanParams, String resultFileName) {
  //创建XLSTransformer对象
  XLSTransformer transformer = new XLSTransformer();
  try {
    //生成Excel文件
    transformer.transformXLS(templateFileName, beanParams, resultFileName);
  } catch (ParsePropertyException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  } catch (InvalidFormatException e) {
    e.printStackTrace();
  }
  return resultFileName;
}

代码示例来源:origin: org.cytoscape/table-import-impl

workbook = WorkbookFactory.create(is);
} catch (InvalidFormatException e) {
  e.printStackTrace();
  throw new IllegalArgumentException("Could not read Excel file.  Maybe the file is broken?");
} finally {

代码示例来源:origin: org.cytoscape/table-import-impl

workbook = WorkbookFactory.create(isStart);
} catch (InvalidFormatException e) {
  e.printStackTrace();
  throw new IllegalArgumentException("Could not read Excel file.  Maybe the file is broken?");
} finally {

相关文章