您现在的位置是:网站首页> 编程资料编程资料

GridView导出Excel常见的5种文本格式[原创]_实用技巧_

2023-05-24 290人已围观

简介 GridView导出Excel常见的5种文本格式[原创]_实用技巧_

1) 文本:vnd.ms-excel.numberformat:@

2) 日期:vnd.ms-excel.numberformat:yyyy/mm/dd

3) 数字:vnd.ms-excel.numberformat:#,##0.00

4) 货币:vnd.ms-excel.numberformat:¥#,##0.00

5) 百分比:vnd.ms-excel.numberformat: #0.00%

用法:在GridView的RowDataBound事件中加入代码e.Row.Cells[0].Attributes.Add("style", "vnd.ms-excel.numberformat:@");

-六神源码网