Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Export
-
Labels:None
-
Application server:tomcat
Description
When I export to excel, I found that the table header is not displayed properly.
But the table body is ok.
I checked the code and found out that if I change the code of method writeHeaderFooter in HssfTableWriter.java
as the following, it works:
private void writeHeaderFooter(String value, HSSFRow row, HSSFCellStyle style)
{
this.currentCell = row.createCell((short) this.colNum++);
this.currentCell.setCellStyle(style);
//cjy
this.currentCell.setEncoding(HSSFCell.ENCODING_UTF_16);
this.currentCell.setCellValue(value);
}
If it is not a bug, I am really very sorry.
But the table body is ok.
I checked the code and found out that if I change the code of method writeHeaderFooter in HssfTableWriter.java
as the following, it works:
private void writeHeaderFooter(String value, HSSFRow row, HSSFCellStyle style)
{
this.currentCell = row.createCell((short) this.colNum++);
this.currentCell.setCellStyle(style);
//cjy
this.currentCell.setEncoding(HSSFCell.ENCODING_UTF_16);
this.currentCell.setCellValue(value);
}
If it is not a bug, I am really very sorry.