解决方法:根据单元格内容长度,设置单元格所在行的行高
public static float getExcelCellAutoHeight(string strtest, float fontCountInline)
{
float defaultRowHeight = 18.00f;//每一行的高度指定
float defaultCount = 0.00f;
for (int i = 0; i <strtest.Length; i++)
{
float ff = getRegex(strtest.Substring(i, 1));
defaultCount = defaultCount + ff;
}
return ((int)(defaultCount / fontCountInline) + 1) * defaultRowHeight;//计算
}
public s