Using custom colors with SXSSF (Apache POI)

后端 未结 3 761
广开言路
广开言路 2021-01-12 02:48

I am trying to write a huge excel file, my requirement allows me to write the row and forget, so i am using SXSSF which allows to keep only a few number of rows in memory an

3条回答
  •  再見小時候
    2021-01-12 03:48

    CellStyle style = workbook.createCellStyle(); // workbook is of SXSSF type
    byte orange[] = new byte[] { (byte) 248, (byte) 203, (byte) 173 };
    byte thick_shade_blue[] = new byte[] { (byte) 142, (byte) 169, (byte) 219 };
    byte blue[] = new byte[] { (byte) 180, (byte) 198, (byte) 231 };
    
    ((XSSFCellStyle) style).setFillForegroundColor(new XSSFColor(thick_shade_blue, null));
    style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    

提交回复
热议问题