Excel 1.导出excel出现数字过长导致科学计数法出现E字: 解决方案:使用vnd.ms-excel.numberformat:@将数字转换为文本 案例: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int count = GridView1.Columns.Count; for (int i = 0; i < count; i++) { e.Row.Cells[i].Attributes.Add("style", "text-align:right;"); } e.Row.Cells[9].Attributes.Add("style", "text-align:right;vnd.ms-excel.numberformat:@"); //e.Row.Cells[3].Attributes.Add("class", "text"); } }
posted on 2012-07-17 10:09  slc  阅读(221)  评论(0编辑  收藏  举报