生成CSV
来源:互联网 发布:网络电视直播系统 编辑:程序博客网 时间:2024/05/18 03:34
string strTitle = "行,制造,机种编码,类型\r\n";
StringBuilder strWriter = new StringBuilder();
strWriter.Append(strTitle);
foreach (GridViewRow row in this.gvPdList.Rows)
{
// 行号
strWriter.Append(row.Cells[0].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + ",");
// LOT编号
strWriter.Append(row.Cells[1].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + ",");
// 机种编号
strWriter.Append(row.Cells[2].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + ",");
// 保税类型
strWriter.Append(row.Cells[3].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + "\r\n");
}
Response.AppendHeader("Content-Disposition", "attachment;filename=BL_Relieve_LotNo.csv");
Response.ContentType = "application/csv";
Response.Charset = "ANSI";
Response.ContentEncoding = System.Text.Encoding.GetEncoding(0);
Page.EnableViewState = false;
Response.Write(strWriter.ToString());
Response.End();
StringBuilder strWriter = new StringBuilder();
strWriter.Append(strTitle);
foreach (GridViewRow row in this.gvPdList.Rows)
{
// 行号
strWriter.Append(row.Cells[0].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + ",");
// LOT编号
strWriter.Append(row.Cells[1].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + ",");
// 机种编号
strWriter.Append(row.Cells[2].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + ",");
// 保税类型
strWriter.Append(row.Cells[3].Text.ToString().Replace(" ", "").Replace(",", ",").Replace("\r\n", "") + "\r\n");
}
Response.AppendHeader("Content-Disposition", "attachment;filename=BL_Relieve_LotNo.csv");
Response.ContentType = "application/csv";
Response.Charset = "ANSI";
Response.ContentEncoding = System.Text.Encoding.GetEncoding(0);
Page.EnableViewState = false;
Response.Write(strWriter.ToString());
Response.End();
- CSV生成
- 生成CSV
- 生成csv,并下载
- jsp 生成csv文件
- PrintWriter 生成 csv 文件
- PHP生成CSV文件
- 生成.csv文件
- CSV文件的生成
- GridView生成.csv文件
- .NET生成CSV文件
- php 生成 csv文件
- CSV文件 生成
- Java生成CSV文件
- Java生成CSV文件
- php生成CSV文件
- java 生成 .csv 文件
- csv格式文件生成实例
- iOS生成csv文件
- android中执行shell
- C++ 小游戏之推箱子
- IIS 5.1成功配置说明
- 从狄仁杰的测字占卜到一淘网的Query分析
- ORA-39213: Metadata processing is not available 解决方法
- 生成CSV
- 从狄仁杰的测字占卜到一淘网的Query分析之大结局
- redhat 5.5系统下安装mw54u无线usb网卡驱动
- volatile关键字的使用
- 把无符号整形字符串转化为整形
- Linux下搭建tomcat集群全记录
- Csharp DataGridView自定义添加DateTimePicker控件日期列
- Consistent hashing kills tencent2012笔试题附加题
- Redhat5.5下安装ORACLE10.2.0.1时报下面错误(1)