首页 > 解决方案 > 使用 apache POI 在 Excel 中消息框中的内容上出现单元格边框

问题描述

我收到以下问题,

在此处输入图像描述

如您所见,橙色单元格的底部边框正在消息框中的消息上方。如何解决这个问题?

 private boolean createComments(int iCell,int iRow ,HashMap<String, String> hMap, XSSFSheet sheet, Row row, CellStyle style, String method){

          XSSFDrawing patr           = sheet.createDrawingPatriarch();

          boolean              errorcheck  = false;

          XSSFComment comment1    = null;

          String strComments      = null;


        if(hMap.containsKey(method) && iRow>0){

                 try{

                       strComments = hMap.get(method);

                       System.out.println("inside createComments--SSSSSSSSSSSSSS-- KKKKKKKKKKKKK");       

                       System.out.println("inside 555555555555555 createComments----JJJJJJJJJJ ");                 

                       comment1 = patr.createCellComment(new XSSFClientAnchor(500, 800, 1500, 1500, (short)iCell, iRow, (short) iCell + 3, iRow +3));                

                       comment1.setString(new XSSFRichTextString(strComments));

                       //row.getCell(iCell).setCellComment(comment1 );

                       row.getCell(iCell).setCellStyle(style);

                       errorcheck = true;

                 }catch(Exception e){

                  }

          }

          return errorcheck;

   }

标签: javaexcelapache-poi

解决方案


推荐阅读