Web数据导出Excel

文本:vnd.ms-excel.numberformat:@
日期:vnd.ms-excel.numberformat:yyyy/mm/dd
数字:vnd.ms-excel.numberformat:#,##0.00
货币:vnd.ms-excel.numberformat:¥#,##0.00
百分比:vnd.ms-excel.numberformat: #0.00%

举例:<td style='vnd.ms-excel.numberformat:@'>123.4</td>

 

代码
Response.Clear();

Response.Buffer 
=   false ;

Response.ContentType 
=   " application/vnd.ms-excel " ;

Response.ContentEncoding 
=  System.Text.Encoding.UTF8;

Response.Charset 
=   " GB2312 " ;

Response.AppendHeader(
" Content-Disposition " " attachment;filename= "   +  Server.UrlEncode( " 员工信息表.xls " ));

Response.Write(strWriter.ToString());

Response.End();

 

 

你可能感兴趣的:(导出Excel)