我在正常应用中使用以下代码,它工作正常。但是当我在jira(简单的Jira插件)中使用相同的代码时,会显示此错误:
org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException:保存失败:保存包时发生错误:空
我是吉拉的新手。请提出我该如何使用。
XSSFWorkbook workbook = null;
XSSFCell cell = null;
FileOutputStream fos = null;
XSSFSheet page_level_sheet;
XSSFRow sheet1_header = null;
try {
workbook = new XSSFWorkbook();
page_level_sheet = workbook.createSheet("Summary");
sheet1_header = page_level_sheet.createRow(0);
sheet1_header.createCell(0).setCellValue("Application Name");;
sheet1_header.createCell(1).setCellValue("Total Urls");;
sheet1_header.createCell(2).setCellValue("Urls With Tags");;
sheet1_header.createCell(3).setCellValue("Coverage %");;
for (int i=1;i<100;i++)
{
sheet1_header = page_level_sheet.createRow(i);
sheet1_header.createCell(0).setCellValue("51115");
sheet1_header.createCell(1).setCellValue("5111d5");
sheet1_header.createCell(2).setCellValue("511f15");
sheet1_header.createCell(3).setCellValue("511v15");
}
fos = new FileOutputStream(new File("D:/poi-generated-file.xlsx"));
workbook.write(fos);
fos.close();
}catch(Exception e)
{
log.info("erorr is "+e);
}