Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java XSSFCellStyle在LibreOffice Calc Ubuntu中不工作_Java_Excel_Ubuntu_Apache Poi_Libreoffice Calc - Fatal编程技术网

Java XSSFCellStyle在LibreOffice Calc Ubuntu中不工作

Java XSSFCellStyle在LibreOffice Calc Ubuntu中不工作,java,excel,ubuntu,apache-poi,libreoffice-calc,Java,Excel,Ubuntu,Apache Poi,Libreoffice Calc,我正在使用ApachePOI3.9创建excel工作表,但在Ubuntu14.04LTS的libreofficeCalc中没有显示边框。如果我在窗口打开同一张纸,一切都会好起来。在下面的代码中需要做哪些更改 private XSSFCellStyle getCommomCellStyle(XSSFWorkbook workbook) { XSSFCellStyle cellStyle = workbook.createCellStyle(); cellStyle.

我正在使用ApachePOI3.9创建excel工作表,但在Ubuntu14.04LTS的libreofficeCalc中没有显示边框。如果我在窗口打开同一张纸,一切都会好起来。在下面的代码中需要做哪些更改

private XSSFCellStyle getCommomCellStyle(XSSFWorkbook workbook) {
        XSSFCellStyle cellStyle = workbook.createCellStyle();
        cellStyle.setAlignment(XSSFCellStyle.ALIGN_LEFT);
        cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
        cellStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN);
        cellStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);
        cellStyle.setBorderRight(XSSFCellStyle.BORDER_THIN);
        cellStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);
        cellStyle.setWrapText(true);
        Font font = workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short)10);
        //      font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
        cellStyle.setFont(font);
        return cellStyle;
    }
在这里你可以看到我没有得到正确的边界和底部边界

备注的下边框实际上是下一个单元格的上边框

请建议我如何解决这个问题


在Windows的LibreOffice中格式正常,但在Ubuntu的LibreOffice中格式错误?在Microsoft office中打开的Windows中,使用
cellStyle.setFillForegroundColor(新XSSFColor(java.awt.Color.YELLOW))解决了其工作的finecolor问题但无法解决边界问题。为什么要使用旧版本的Apache POI?升级时会发生什么情况?即使使用poi 3.16,同样的问题在Windows的LibreOffice中格式正常,在Ubuntu的LibreOffice中格式错误?在Windows中,我在Microsoft office中打开了一个窗口,使用
cellStyle.setFillForegroundColor(新的XSSFColor(java.awt.Color.YELLOW))解决了它的工作精细度问题但无法解决边界问题。为什么要使用旧版本的Apache POI?升级时会发生什么?即使使用poi 3.16,也会出现同样的问题