You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2022/11/22 09:18:14 UTC

[Bug 66360] New: Row Span borders render not correctly working with RegionUtil

https://bz.apache.org/bugzilla/show_bug.cgi?id=66360

            Bug ID: 66360
           Summary: Row Span borders render not correctly working with
                    RegionUtil
           Product: POI
           Version: 5.2.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: vincent.lelostec@gmail.com
  Target Milestone: ---

Created attachment 38438
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38438&action=edit
Expected borders and reality

Hi there,

I'm facing an issue trying to set borders on an merged region applying a Row
Span. The version I uesd is 5.2.3 but not listed here.

the code used bellow :

if (!BorderStyle.NONE.equals(excelStyle.getBorderBottom())) {
  RegionUtil.setBorderBottom(excelStyle.getBorderBottom(), mergedRegion,
excelSheet);
  RegionUtil.setBottomBorderColor(excelStyle.getBottomBorderColor(),
mergedRegion, excelSheet);
}

if (!BorderStyle.NONE.equals(excelStyle.getBorderTop())) {
  RegionUtil.setBorderTop(excelStyle.getBorderTop(), mergedRegion, excelSheet);
  RegionUtil.setTopBorderColor(excelStyle.getTopBorderColor(), mergedRegion,
excelSheet);
}

if (!BorderStyle.NONE.equals(excelStyle.getBorderLeft())) {
  RegionUtil.setBorderLeft(excelStyle.getBorderLeft(), mergedRegion,
excelSheet);
  RegionUtil.setLeftBorderColor(excelStyle.getLeftBorderColor(), mergedRegion,
excelSheet);
}

if (!BorderStyle.NONE.equals(excelStyle.getBorderRight())) {
  RegionUtil.setBorderRight(excelStyle.getBorderRight(), mergedRegion,
excelSheet);
  RegionUtil.setRightBorderColor(excelStyle.getRightBorderColor(),
mergedRegion, excelSheet);
}

In my tests i go throughout all conditions, this works good for the Column
span, But for the Row span the behavior of the borders isn't the one I expected
(see the attachments).

The script of the code is this : 

 - I compute the XSSFCellStyle
 - Then I apply the style to the current cell
 - And finaly, if a span is defined on this cell, I create a CellRangeAddress,
add it to the merged regions and apply the borders with the code above.

I try differents scripts (create the merged region before applying styles...)
but the result is always the same as the attachment. 

Is this a bug or I missused RegionUtil ?

Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 66360] Row Span borders render not correctly working with RegionUtil

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66360

vincent.lelostec@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from vincent.lelostec@gmail.com ---
I there, I tried many solutions but it seems that I made a mistake using
RegionUtil with XSSF styles.

I fix all my borders issues (style and colors) by setting the style wanted in
all the cell being part of the merged region (before that, I only created the
first cell of the merged region, applied the style to it and then created the
merged region and I think this is the problem)

I close the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org