Apache POI: Wie man einen diagonalen Rand hinzufügt

Ich möchte @ verwendApache POI zeichnenDiagonal Border aber ich konnte keine Funktion finden, die diese Funktion unterstützt.

Ich habe es versucht setBorderDiagonal aber es funktioniert nicht.

XSSFSheetConditionalFormatting my_cond_format_layer = my_sheet.getSheetConditionalFormatting();

XSSFConditionalFormattingRule my_rule = my_cond_format_layer.createConditionalFormattingRule(ComparisonOperator.BETWEEN, "14", "16");
XSSFConditionalFormattingRule my_rule_2 = my_cond_format_layer.createConditionalFormattingRule(ComparisonOperator.EQUAL, "33");
XSSFPatternFormatting fill_pattern_2 = my_rule_2.createPatternFormatting();
fill_pattern_2.setFillBackgroundColor(IndexedColors.YELLOW.getIndex());

XSSFBorderFormatting borderFormatting = my_rule_2.createBorderFormatting();
borderFormatting.setDiagonalBorderColor(IndexedColors.BLUE.getIndex());
borderFormatting.setBorderDiagonal(BorderFormatting.BORDER_THICK);

ConditionalFormattingRule[] multiple_rules = {my_rule, my_rule_2};
CellRangeAddress[] my_data_range = {CellRangeAddress.valueOf("A1:A4")};
my_cond_format_layer.addConditionalFormatting(my_data_range, multiple_rules);

Antworten auf die Frage(2)

Ihre Antwort auf die Frage