Bug 53564 - Cannot draw a diagonal border
Summary: Cannot draw a diagonal border
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.8-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 11:23 UTC by Xen
Modified: 2016-07-19 10:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.