展开文本在Excel中被忽略

我有asp.net mvc项目,在这个项目中,我创build了带有模型数据的excel文档,现在正在尝试使用它的外观。 我有唯一的问题 – 在less数情况下,我的xlWorkSheet.Cells[y, x].WrapText = false; 被忽略…

我的项目描述字段代码:

 ...//other fields if (model.ColumnsNeeded.ProjectDescriptionBool) { xlWorkSheet.Cells[y, x].Style.WrapText = false; xlWorkSheet.Cells[y, x++] = projItem.ProjectDescription; } ...//other fields 

和excel结果我得到,当点击包装的文本字段CAS时,看到属性包装文本设置: 在这里输入图像说明

以及我已经设置的foreach行: xlWorkSheet.Cells[y, x].EntireRow.WrapText = false;