首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

关于导出excel 自定换行有关问题

2012-03-14 
关于导出excel 自定换行问题本人做了一个excel 导出, 是输出 html 直接导入excel ,导入进去,数据自动换行

关于导出excel 自定换行问题
本人做了一个excel 导出, 是输出 html 直接导入excel ,导入进去,数据自动换行了,需求是不能换行,怎么做到
  sbHtml.Append("<td style=\"width:40px; text-align:center; vertical-align:middle;font-size:15px; font-weight: bold; height:49px;\">" + day + "</td>");

本人代码

[解决办法]
把导出到Excel的代码给出来看看啊,

C# code
System.IO.StringWriter sw = new System.IO.StringWriter();sw.Write("<td style=\"width:40px; text-align:center; vertical align:middle;font-size:15px; font-weight: bold; height:49px;\">" + 0 + "</td>");sw.Close();Response.Clear();Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("测试", System.Text.Encoding.UTF8) + DateTime.Now.ToShortDateString() + ".xls");Response.ContentType = "application/ms-excel";Response.Write(sw);Response.End(); 

热点排行