I don't know. I will have to think on this one. -----Original Message----- From: Javen O'Neal [mailto:javenon...@gmail.com] Sent: Wednesday, December 30, 2015 4:09 AM To: POI Users List Subject: Re: Documentation for XSSF
Mark, Is this a request to modify the website documentation, comments or java docs in the source code, or Java code/functionality, or unit test behavior, or a combination thereof? I'm a bit unclear what needs done here. Could you open a bug and if you have a suggestion for how to fix the bug, attach a patch? The website documentation is generated from xml sources (don't worry about providing html diffs) https://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/ The Java code for XSSFWorkbooks is https://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/ and https://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/ss/ The unit test code for XSSFWorkbooks is https://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/ and https://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/ss/ Thanks for helping and happy holidays! Javen On Fri, Dec 18, 2015 at 10:14 AM, Murphy, Mark <murphym...@metalexmfg.com> wrote: > Wow, that got totally hosed. Not sure where all those <file> references came > from, but here it is without them. > > -----Original Message----- > From: Murphy, Mark [mailto:murphym...@metalexmfg.com] > Sent: Friday, December 18, 2015 9:48 AM > To: user@poi.apache.org > Subject: Documentation for XSSF > > Excel has an inconsistency in its fills. A solid fill defined for a cell > needs a foreground color: > > <fill> > <patternFill patternType="solid"> > <fgColor rgb="FFFFFF00"/> > <bgColor indexed="64"/> > </patternFill> > </fill> > <fill> > <patternFill patternType="solid"> > <fgColor indexed="65"/> > <bgColor rgb="FFFFFF00"/> > </patternFill> > </fill> > > This first fill shows in Excel as a cell with a yellow background, the second > shows in excel with a white background (neither have borders). In the excel > Format Cells dialog, the first happens by selecting Yellow as the background > color, and leaving Pattern Color and Style alone, the second fill shows No > Color for the background color with Yellow Pattern Color and blank Pattern > Style. > > In the Conditional Formatting space, however, the resulting xml and behavior > is reversed for patternType='solid': > > <dxf> > <fill> > <patternFill patternType="solid"> > <bgColor rgb="FFFFFF00"/> > </patternFill> > </fill> > </dxf> > > This was arrived at in the Format Cells dialog by selecting Yellow as the > Background Color, and leaving Pattern Color and Style alone. Note that > bgColor is set here instead of Foreground color. With testing, it appears > that in almost all instances bgColor corresponds with Background Color in the > dialog, and fgColor corresponds with Pattern Color. The only exception is the > initial example. It should be documented somewhere that > setFillBackgroundColor sets the background color of the cell, and > setForegroundColor sets the color of the pattern except when the fill is > applied to a CellStyle and the pattern is SOLID_FOREGROUND. That being the > case SOLID_FOREGROUND is somewhat a misnomer when dealing with Conditional > Formats as you need to set the background color not the foreground color when > you select pattern SOLID_FOREGROUND. I don't know whether the solution is to > add a new constant such as SOLID that exhibits the appropriate bug or just to > document the issue so that folks using it know to use setForegroundColor when > it applies to CellStyle and SOLID_FOREGROUND, and setBackgroundColor at all > other times. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional > commands, e-mail: user-h...@poi.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional commands, e-mail: user-h...@poi.apache.org