我在转的过成中,table里的文本是可以转的,但html里的checkbox,radio这些单选和复选筐,空件,转到excel里就不完整了,是乱的.我两中方法转都是的
1.是直接把后缀htm该为slx
2.在程序里写代码
HttpContext.Current.Response.Buffer = true;
// HttpContext.Current.Response.Charset = "gb2312";
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default; HttpContext.Current.Response.ContentType = "application nd.ms-excel";
HttpContext.Current.Response.AddHeader("content-disposition:attachment", "inline;filename=" + HttpUtility.UrlEncode("招商银行特约商户开户内部审批表" + ".xls"));
1.是直接把后缀htm该为slx
2.在程序里写代码
HttpContext.Current.Response.Buffer = true;
// HttpContext.Current.Response.Charset = "gb2312";
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default; HttpContext.Current.Response.ContentType = "application nd.ms-excel";
HttpContext.Current.Response.AddHeader("content-disposition:attachment", "inline;filename=" + HttpUtility.UrlEncode("招商银行特约商户开户内部审批表" + ".xls"));
我试过只要是html里的空件转到excel里都是乱的,包括textBox文本空件。
但是表格里的纯文字就没有问题