惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
D
DataBreaches.Net
B
Blog RSS Feed
D
Docker
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Y
Y Combinator Blog
A
About on SuperTechFans
V
V2EX
罗磊的独立博客
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
月光博客
月光博客
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志

博客园 - 丹心猪(Dansinge)

尘封出关之三——事隔一年多,实现了营业额100万的目标 复习static 尘封出关之二 —— 继续坚持 尘封出关之一 —— 提前出关 程序员开始非技术创业 尘封两年 [处男|转]一个男人在感情上的堕落经历 决定静下心学习ASP.NET Ajax 卷着一身疲困起床,拖回一身疲惫睡觉,我已经开始不喜欢这样的生活了 Oracle转成Sql server之郁闷传奇 接到非常急重的项目,将渡过非人的35天!(国庆不知道能不能休息) |set| 2006-09-23 |get| 2006-09-22 |set| 2006-09-22 |get| 2006-09-21 |set| 2006-09-21 |get| 2006-09-20 |set| 2006-09-20 |get| 2006-09-18 |set| 2006-09-19
|get| 2006-09-19
丹心猪(Dansinge) · 2006-09-19 · via 博客园 - 丹心猪(Dansinge)

产生一个免保存在服务器端的流,直接下载

 1StringWriter sw=new StringWriter();
 2            sw.WriteLine("科目名称\t凭证日期\t借方\t贷方");
 3            string s="";
 4            foreach(DataRow dr in Items.Rows)
 5            {
 6                s = dr["AccountName"].ToString();
 7                s += "\t" + Convert.ToDateTime(dr["VouDate"]).ToString("yyyy-MM-dd");
 8                s += "\t" + dr["Debit"].ToString() + "\t" + dr["Credit"].ToString();
 9                sw.WriteLine(s);
10            }

11            sw.Close();
12            Response.Clear();
13            Response.AddHeader("Content-Disposition""attachment; filename=filename.xls");
14            Response.ContentType = "application/ms-excel            Response.ContentEncoding=System.Text.Encoding.Default;
15            Response.Write(sw);// 把流发送到客户端 
16            Response.End();

posted @ 2006-09-19 17:38  丹心猪(Dansinge)  阅读(205)  评论(0)    收藏  举报

刷新页面返回顶部