I found the solution. Just for the sake of documentation, the problem was about handling CellStyle the proper way.
I was using it like this: XSSFCellStyle highlight = cell.getCellStyle() All I had to do to fix it was change it to be like below: CellStyle highlight = sheet.getWorkbook().createCellStyle() Cheers On Fri, Sep 18, 2015 at 2:34 PM, Felipe Carvalho <[email protected]> wrote: > Hello, > > I'm using poi-3.12 to generate a XLSX file (sample attached), but I'm > afraid I might be doing something wrong here. What I need to do is have a > single cell highlighted in yellow. > > When I open this XLSX file using OpenOffice it all looks good, just one > cell is highlighted. Nevertheless, when I open it using Numbers, from > Apple, the entire spreadsheet is yellow, not just the cell I wanted > (screenshot attached). And on MS Excel the cell has no background color > whatsoever (screenshots attached). > > I've followed the tutorial classes available on > https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/NewLinesInCells.java > and > https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/FillsAndColors.java > . > > Would anyone know if this is a known issue, or if I'm doing anything wrong > here? > > Thanks a lot! > > Felipe >
