poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Bell <stephendb...@gmail.com>
Subject How and when to inherit CellStyle for Cell from Row?
Date Thu, 09 Sep 2010 15:06:21 GMT
We're using POI to place data in an existing spreadsheet and the user
is complaining that the row background fill colur is not being

As a simple case, imagine a blank spreadsheet, Excel 97 format. Set
the background fill for column A to cyan, say. Set the background fill
for row 1 to red. Cell A1 now appears red, and were I to type into it
would remain red. Instead, I save the spreadsheet. It has no cells,
but it has a row, and it has column attributes for column A.

Now I use POI to place data in cell A1. How do I preserve the
observable cell style? When I try it, if I simply create cell number 0
in row 0, it respects the column style but not the row style. I
believe I can get hold of the row style via the HSSFRow.getRowStyle()
method, but how do I know whether it is the row style or the column
style that should take precendence?

To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message