ASP.NET数据库导入Excel
2010-03-09 18:21
323 查看
StringWriter sw = new StringWriter();
sw.WriteLine("访问购买率");
sw.WriteLine("排行/t商品名称/t人气指数/t购买次数/t访问购买率");
int i = 0;
foreach (ProductSaleInfo productSale in productSaleList)
{
i = i + 1;
sw.WriteLine(i.ToString() + "/t" + productSale.Name.ToString() + "/t" + productSale.ViewCount.ToString() + "/t" + productSale.SaleCount.ToString() + "/t" + XWXCommon.ProductBuyRate(productSale.ViewCount.ToString(), productSale.SaleCount.ToString()));
}
sw.Close();
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition", "attachment;filename=visit_sold.xls");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.ContentType = "application/ms-excel";
Response.Write(sw);
Response.End();
sw.WriteLine("访问购买率");
sw.WriteLine("排行/t商品名称/t人气指数/t购买次数/t访问购买率");
int i = 0;
foreach (ProductSaleInfo productSale in productSaleList)
{
i = i + 1;
sw.WriteLine(i.ToString() + "/t" + productSale.Name.ToString() + "/t" + productSale.ViewCount.ToString() + "/t" + productSale.SaleCount.ToString() + "/t" + XWXCommon.ProductBuyRate(productSale.ViewCount.ToString(), productSale.SaleCount.ToString()));
}
sw.Close();
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition", "attachment;filename=visit_sold.xls");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.ContentType = "application/ms-excel";
Response.Write(sw);
Response.End();
相关文章推荐
- asp.net将本地Excel上传到服务器并把数据导入到数据库
- 将Excel内容导入数据库(ASP.NET/C#)
- ASP.NET中数据库数据导入Excel并打印
- ASP.NET中数据库数据导入Excel并打印
- C# 或Asp.Net 将excel表格导入数据库
- ASP.NET下将不规则的Excel导入数据库
- ASP.NET Excel数据导入数据库
- asp.net中EXCEL数据导入到数据库的方法
- ASP.NET导入Excel到数据库(SQL)
- asp.net Excel导入数据到数据库 详细教程
- ASP.NET中数据库数据导入Excel并打印
- ASP.NET中数据库数据导入Excel并打印
- ASP.NET中数据库数据导入Excel并打印
- asp.net EXCEL数据 导入到数据库
- ASP.NET中数据库数据导入Excel并打印
- ASP.NET中数据库数据导入Excel并打印(1)
- ASP.NET导入Excel到数据库(SQL)
- ASP.NET Excel数据导入数据库---2
- 用asp.net将Excel导入到数据库并显示
- ASP.NET中数据库数据导入Excel并打印