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();