回复 1楼星星蓝箭的帖子
需要设置单元格类型来显示折行,请使用以下代码测试:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- GeneralCellType gct = new GeneralCellType();
- gct.Multiline = true;
- gct.AllowWrap = true;
- this.FpSpread1.Sheets[0].Cells[0, 0].Text = "a\nb\n";
- this.FpSpread1.Sheets[0].Cells[0, 0].CellType = gct;
- }
复制代码 |