1.导出excel行显示不完整数据客户不满意,需要我们处理
for (int rowNum = ; rowNum <= sheet.LastRowNum; rowNum++)
{
HSSFRow currentRow = sheet.GetRow(rowNum);
HSSFCell currentCell = currentRow.GetCell(); HSSFCell currentCell21 = currentRow.GetCell();
int length = Encoding.UTF8.GetBytes(currentCell.ToString()).Length;//获取当前单元格的内容宽度
int length2 = Encoding.UTF8.GetBytes(currentCell21.ToString()).Length;//获取当前单元格的内容宽度
if (length2 > length)
{
currentRow.HeightInPoints = * (length2 / + );
}
else
{
currentRow.HeightInPoints = * (length / + );
} }
备注:比较索引为6,21 的列,判断设置行高的标准