java - SXSSF generated corrupted report in Z/OS on applying cell Style -
i trying execute program in z-os machine write excel report. due size of report, using sxssfworkbook write report.
one of cells in report grey in color. have apply color cell. used following code set color.
xssfcellstyle cellstyle = (xssfcellstyle) wb.createcellstyle(); xssfcolor mycolor = new xssfcolor(datatypeconverter .parsehexbinary("ffbfbfbf")); //also tried java.awt.color cellstyle.setfillforegroundcolor(mycolor); cell.setcellstyle(cellstyle);
but report generated, cell dark in color. out of curiosity, checked styles.xml inside excel document. following found.
<fill><patternfill patterntype="solid"><fgcolor rgb="ããâãâãâã"/></patternfill></fill>
i tried generate same report in windows machine, , gave me correct result.
<fill><patternfill patterntype="solid"><fgcolor rgb="ffbfbfbf"/></patternfill>
can me resolve issue?
----------------------edited---------------------------
i have reported bug this. https://issues.apache.org/bugzilla/show_bug.cgi?id=56683
to debug this, need see code ct classes in poi. followed instructions given in following link generate code. http://poi.apache.org/faq.html#faq-n1012a
1) not able find ' ooxml-schemas-src jar'. 2) checkedout poi code , ant build it.
none of approch gave me code ct classes. let me know if have done before.
---------------edited----------------------------
not sure if following update fix it. need try out.
updated writeto() method of 'org.apache.poi.xssf.model.stylestable'.
change: added following line
'default_xml_options.setcharacterencoding("utf-8");' /** * write table out xml. * * @param out stream write to. * @throws ioexception if error occurs while writing. */ public void writeto(outputstream out) throws ioexception { //setting default encoding utf-8 default_xml_options.setcharacterencoding("utf-8"); xmloptions options = new xmloptions(default_xml_options);
since dont have control on z/os server, have wait till tested. in mean time, please let me know thoughts on same.
this resolved now.
please see bug page details. https://issues.apache.org/bugzilla/show_bug.cgi?id=56683
Comments
Post a Comment