Bug 53564

Summary: Cannot draw a diagonal border
Product: POI Reporter: Xen <a523z>
Component: HSSFAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 3.8-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Xen 2012-07-18 11:23:20 UTC
Hi evetyone,
I'm working with the 3.8 version of POI
and have problem when I try to set the Diagonal border of a cell
it doesn't appear

Below is the sample code: 

HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheetConditionalFormatting scf = wb.createSheet("Page 1").getSheetConditionalFormatting();
HSSFConditionalFormattingRule rule = scf.createConditionalFormattingRule(ComparisonOperator.GT, "10");
HSSFFontFormatting font = rule.createFontFormatting();
font.setStrikeout(true);
HSSFBorderFormatting bord = rule.createBorderFormatting();
bord.setBorderDiagonal(BorderFormatting.BORDER_THICK);
bord.setBorderBottom(BorderFormatting.BORDER_THICK);
bord.setBottomBorderColor((short)30);
bord.setDiagonalBorderColor((short)30);
CellRangeAddress[] cra = {new CellRangeAddress(1, 3, 0, 3)};
scf.addConditionalFormatting(cra, rule);

Thanks for your help.
Comment 1 Javen O'Neal 2016-07-19 10:13:28 UTC
I added a unit test for this in r1753359. This is still failing in POI 3.15 beta 2+, at least as far as I've been able to test with LibreOffice.

One thing your test case was likely missing was border.setForwardDiagonalOn(true), since setting the border thickness and color isn't enough to turn on the diagonal borders.