Issue Details (XML | Word | Printable)

Key: DISPL-307
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Reporter: Mike Lindenblatt
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DisplayTag

ExcelHssfView sets Encoding for headerColumn too late

Created: 10/Mar/06 07:15 AM   Updated: 21/Feb/07 06:38 AM   Resolved: 25/Mar/06 11:43 AM
Return to search
Component/s: Export
Affects Version/s: 1.1
Fix Version/s: 1.1.1

Time Tracking:
Original Estimate: 3 minutes
Original Estimate - 3 minutes
Remaining Estimate: 3 minutes
Remaining Estimate - 3 minutes
Time Spent: Not Specified
Time Spent - Not Specified


 Description  « Hide
in ExcelHssfView:

line 127-129 the encoding should be set first: Please Correct this:

wrong:
cell.setCellValue(columnHeader);
cell.setCellStyle(headerStyle);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);

right:
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellValue(columnHeader);
cell.setCellStyle(headerStyle);


This is taken from the documentation:
setCellValue:
set a string value for the cell. Please note that if you are using full 16 bit unicode you should call setEncoding() first.


fabrizio giustina added a comment - 25/Mar/06 11:43 AM
fixed as suggested, thanks

Giorgos Saslis-Lagoudakis added a comment - 21/Feb/07 06:38 AM
Don't know if you've fixed this already, but the DefaultHSSFExportView -- which makes use of the HssfTableWriter class to create the table -- has the same issue. This needs to be addressed in the writeHeaderFooter(String value, HSSFRow row, HSSFCellStyle style) method of the HssfTableWriter class as well:

wrong:
this.currentCell.setCellValue(value);
this.currentCell.setCellStyle(style);
this.currentCell.setEncoding(HSSFCell.ENCODING_UTF_16);


right:
this.currentCell.setEncoding(HSSFCell.ENCODING_UTF_16);
this.currentCell.setCellValue(value);
this.currentCell.setCellStyle(style);


thanks!
Giorgos