Summary: | probelem re: creating a cell with borders on a template that was read in | ||
---|---|---|---|
Product: | POI | Reporter: | Stephen <stephen> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | major | ||
Priority: | P3 | ||
Version: | 2.0-pre3 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Stephen
2003-02-27 15:45:16 UTC
Omit the statement: After trying several cells, the Format...Cells function starts to work properly. It does NOT start to work properly. Has this been fixed in the 2.0-pre2 release? I think it was some time ago. Please let us know if it works with 2.0-pre2. Can someone do a compilable testcase please? I dont understand this bug!! Can someone do a compilable testcase please? I dont understand this bug!! sorry, didnt mean to close bug Just add a border to a cell using the usermodel, save the file and open it with Excel (2000, or XP or whatever). When you try to RightClick on the bordered cell to view the cell format dialog it does not work. The Cell format dialog does not appear at all. Maybe are the biff codes for cell borders not well written? It's a major flaw if you think the end user may want to retouch manually the spreadsheet. The bug is still active for POI-3.0.1-FINAL. Just set a border style of a cell: cell.getCellStyle().setBorderLeft(HSSFCellStyle.BORDER_THIN) and the a right click on the bordered cell in Excel XP to view the cell format dialog it does not work. You should set both border style and border color: style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setTopBorderColor(HSSFColor.BLACK.index); This way it works fine for me. Regards, Yegor As you mentioned, I tried the following: style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setTopBorderColor(HSSFColor.BLACK.index); and it works. But if I try to copy a color from a different cell style, the same problem occurs: style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setTopBorderColor(otherValidCellStyle.getTopBorderColor()); HSSFColor.BLACK.index = 8 otherValidCellStyle.getTopBorderColor() = 0 Setting the BorderColor to zero will result in the problem that the cell format dialog does not appear anymore. zero is not valid color index. If otherValidCellStyle.getTopBorderColor() returns 0 it means that otherValidCellStyle does not have top border. But if you call otherValidCellStyleWithTopBorder.getTopBorderColor() it should work. Regards, Yegor |