How to apply background color for the rows in exce

2019-06-14 23:25发布

I am using Apache POI for exporting data into excel sheet. it works fine. the problem is i need apply yellow background color for few rows in the excel sheet while generating the excel sheet. please hellp me how to apply background color for the rows of excel sheet while generating.

Thanks, Reddy

1条回答
做个烂人
2楼-- · 2019-06-14 23:48

straight from the official guide:

    // Aqua background
CellStyle style = wb.createCellStyle();
style.setFillBackgroundColor(IndexedColors.AQUA.getIndex());
style.setFillPattern(CellStyle.BIG_SPOTS);
row.setRowStyle(style);
查看更多
登录 后发表回答