我正在尝试为一个单元格添加多个cellStyles,但是最后一个单元格样式将覆盖现有的单元格样式。如何同时添加这两种单元格样式?
...
CellStyle numberStyle = Workbook.createCellStyle();
DataFormat numberFormat = Workbook.createDataFormat();
numberStyle.setDataFormat(numberFormat.getFormat("0.00;[Red]0.00"));
CellStyle dollarStyle= Workbook.createCellStyle();
DataFormat dollarFormat = Workbook.createDataFormat();
dollarStyle.setDataFormat(dollarFormat.getFormat("$#,#0.00"));
cell5.setCellStyle(numberStyle);
cell5.setCellStyle(dollarStyle);
...