首页 > 解决方案 > 我正在使用带有 atlassian jira 的 `org.apache.poi` api,但它给出了错误

问题描述

我在正常应用程序中使用下面的代码,它工作正常。但是当我在 jira(简单的 Jira 插件)中使用相同的代码时,它会显示这个错误:

org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException:保存失败:保存包时出错:null

我是吉拉的新手。请建议我如何使用。

 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);
   }

标签: javaapacheapache-poijira

解决方案


推荐阅读