在导出到excel的时候,有一些数据比如说:
原本数据:3/3 ;但是它会以日期形式显示出来,导致这条数据出现错误
在往excel中添加数据的时候,在数据的前面加单引号
如:Sheet.Cells[iRow, iCol] ="'"+ ds.Tables[0].Rows[iRow - 3][itm.ID].ToString();
通过REsponse.Write写的时候在样式中添加------样式::
如: Response.Write(string.Format(" <td style=\" width:200px; height:30px: vnd.ms-excel.numberformat:@\">{0}</td> ", tempTable.Rows[i]["expertPercent"]));