Some Errors by serializing with the HSSFGenerator generated Excel-Sheet with 
style-informations (no Problems without)
---------------------------------------------------------------------------------------------------------------------

                 Key: COCOON-1958
                 URL: http://issues.apache.org/jira/browse/COCOON-1958
             Project: Cocoon
          Issue Type: Bug
          Components: Blocks: POI
    Affects Versions: 2.1.9
            Reporter: Rolf Metternich


For building an Excel-Sheet, I have to generate an Excel-Sheet by 
HSSFGenerator, manulpulate the values by a transformer and serialize as an 
Excel-Sheet.

The first test are: generating an Excel-Sheet and serialize direct. Then, in 
the optimal case, the Excel-Sheet looks like the original. But there raised 
some error for which I made a workaround.

First there was a NPE for fore- and background-colors by generation.
I made a try-catch and set 'new HSSFColor.BLACK().getHexString()' for the 
foreground-color and 'new HSSFColor.WHITE().getHexString()' for the background 
when an error occures.
This error occures only in cells, where the fore- and background-settings in 
Excel are automatic and none.

patternColor (error on serializing) I set to 'attribute("PatternColor", new 
HSSFColor.WHITE().getHexString())';

Bold  (error on serializing)  I set the attribute from 
'Short.toString(font.getBoldweight())' to 
((font.getBoldweight()>=font.BOLDWEIGHT_BOLD ) ? "1":"0").

With this workaround, the generation-serialization of the Excel-Sheet work, but 
no images are imported, like a logo-jpg.

  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to