Repeater导出Excel如何 让Excel适应内容改变宽度
Repeater导出Excel如何 让Excel适应内容改变宽度
固定 也行 求教
[最优解释]
同学,不知道你有没有试过在response.write数据的时候给你所输出的内容定义一个样式呢?
response.Clear();
response.AddHeader("content-disposition", string.Format("attachment; filename={0}.xls", HttpUtility.UrlEncode(Encoding.UTF8.GetBytes(fileName))));
response.ContentType = "application/vnd.ms-excel";
response.Charset = "GB2312";
response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
response.Write(string.Format(@"<html><head><meta http-equiv=Content-Type content=""text/html; charset=GB2312""><style>{0}</style><script type='text/javascript'>{1}</script></head><body>", GetStyleForTravelLine(), GetJavascriptForTravelLine(OrderNumber, OutString)));
response.Write(content);
response.Write("");
response.Write("</body></html>");
response.Flush();
try
{
response.End();
}
catch { }
[其他解释]
StringWriter 和Response 输出的时候设置td 的宽度。
参考
http://blog.csdn.net/limeiyu/article/details/5676177
[其他解释]
现在数据导出到excle都是通过NPOI来做了,很少会写原来的那种方式
[其他解释]
自己顶起up
[其他解释]
我之间用的Rpepeater导出 啊 Repeater里面的table 我给了宽度但是没用
[其他解释]
4L你的我试过了 那个貌似只能给 颜色什么的。。表格宽度就不行。。。。
[其他解释]
找到方法了 。。散分