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 2018/09/21 14:34:16 UTC

[Bug 62753] New: Background color is always black for a merged cell

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

            Bug ID: 62753
           Summary: Background color is always black for a merged cell
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: apulbere@yahoo.com
  Target Milestone: ---

Created attachment 36159
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36159&action=edit
example of problem

I'm using the following code to set the background color for cells:

XSSFCellStyle cellStyle = (XSSFCellStyle) excelStyle.getCellStyle();
cellStyle.setFillForegroundColor(new XSSFColor(new byte[]{(byte) 14, (byte)
173, (byte) 108}, new DefaultIndexedColorMap()));
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);

But I'm always getting black background for a merged cell.
Also, I've tried this way:

cellStyle.setFillForegroundColor(new
XSSFColor(java.awt.Color.decode("#0ead6c")));

but this same result.
It works only if I'm using IndexedColors like:

cellStyle.setFillForegroundColor(IndexedColors.CORAL.index);


Additional info:
SXSSFWorkbook
poi:3.17
poi-ooxml:3.17

-- 
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 62753] Background color is always black for a merged cell

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

--- Comment #1 from apulbere@yahoo.com ---
seems that problem is in 
org.apache.poi.ss.util.RegionUtil#setBorderTop

if I apply style in this order, then it's ok:
1. merge cells
2. set border for merge region
3. set background color for merged cell

-- 
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 62753] Background color is always black for a merged cell

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

apulbere@yahoo.com changed:

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

-- 
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