/**
* 根据行内容重新计算行高
* @param row
*/
public static void calcAndSetRowHeigt(HSSFRow sourceRow) {
for (int cellIndex = sourceRow.getFirstCellNum(); cellIndex <= sourceRow.getPhysicalNumberOfCells(); cellIndex++) {
//行高
double maxHeight = sourceRow.getHeight();
HSSFCell sourceCell = sourceRow.getCell(cellIndex);
//单元格的内容
String cellContent = getCellContentAsString(sourceCell);
if(null == cellContent || "".equals(cellContent)){
continue;
}
//单元格的宽高及单元格信息
MapcellInfoMap = getCellInfo(sourceCell);
Integer cellWidth = (Integer)cellInfoMap.get("width");
Integer cellHeight = (Integer)cellInfoMap.get("height");
if(cellHeight > maxHeight){
maxHeight = cellHeight;
}
System.out.println("单元格的宽度 : " + cellWidth + " 单元格的高度 : " + maxHeight + ", 单元格的内容 : " + cellContent);
HSSFCellStyle cellStyle = sourceCell.getCellStyle();
HSSFFont font = cellStyle.getFont(sourceRow.getSheet().getWorkbook());