我從gridview導出爲excel。有什麼方法可以格式化標題文本並將其包裝在Excel中? 我導出到Excel代碼從gridview c#格式導出爲excel標題文本
grdCommon.Font.Size = FontUnit.XSmall;
grdCommon.GridLines = GridLines.Both;
grdCommon.Style["font-family"] = "Arial, Helvetica, sans-serif;";
grdCommon.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
grdCommon.HeaderStyle.ForeColor = System.Drawing.Color.White;
grdCommon.HeaderStyle.BackColor = System.Drawing.Color.FromArgb(80, 124, 209);
grdCommon.HeaderStyle.Font.Size = 8;
grdCommon.HeaderStyle.Width = 30;
我試過如下增加格式化Excel中的標題列。但Excel的頭犯規被包梁
grdCommon.HeaderRow.Style.Value = "word-break:break-all;word-wrap:break-word";
grdCommon.HeaderRow.Cells[0].Wrap = true;
和改進這種方法
grdCommon.HeaderRow.Style.Add("background-color", "#FFFFFF"); as
grdCommon.HeaderRow.Style.Add("word-wrap","true");
任何建議...