开发学院数据库MSSQL Server DataSet导出到Excel比较完整的解决方案(一)--客... 阅读

DataSet导出到Excel比较完整的解决方案(一)--客户端生成文件(downmoon)

 2009-01-16 10:19:16 来源:WEB开发网   
核心提示: 可惜, 生成的倒是XML格式了,DataSet导出到Excel比较完整的解决方案(一)--客户端生成文件(downmoon)(4),但还是上传格式不正确,考虑到客户端可能是Excel2007/2003-97等等,决定放弃保存Excel到客户端的方式,第三种尝试方案:用cvs保存

可惜, 生成的倒是XML格式了,但还是上传格式不正确,考虑到客户端可能是Excel2007/2003-97等等,决定放弃保存Excel到客户端的方式。

第三种尝试方案:用cvs保存,将第一种方法改为:

ExportToCVS
 Response.ContentType = "text/csv";//"application/vnd.ms-excel";
      Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName + ".cvs");

生成格式大致如下:

CVS格式

"品名","最高价格","最低价格","平均价格","计量单位","备注"
"青菜","","","","元/公斤",""
"南瓜","","","","元/公斤",""
"瓠子","","","","元/公斤",""
"冬春笋","","","","元/公斤",""
"雪里蕻","","","","元/公斤",""
"樱桃萝卜","","","","元/公斤",""
"佛手瓜","","","","元/公斤",""
"白菜鼎","","","","元/公斤",""
"蒜","","","","元/公斤",""
"食用菌","","","","元/公斤",""
"黄瓜","","","","元/公斤",""

上一页  1 2 3 4 5 6  下一页

Tags:DataSet 导出 Excel

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接