光滑的方式为用户下载生成CSV? [英] Slick way to generate a CSV for user download?

查看:42
本文介绍了光滑的方式为用户下载生成CSV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试谷歌这个但是已经获得了太多的点击量来使用它们。是否有一种灵活的方式来生成CSV或其他Excel友好的

格式并将其推送到客户端?我在ASP页面上使用VBScript(以及HTML和其他

典型的东西)(没有.NET的东西)。只需推动

正确的方向就是我真正需要的。

I''ve been trying to Google this but have been getting far too many hits to
be of use. Is there a slick way to generate a CSV or other Excel-friendly
format and push it to the client? I''m using VBScript (and HTML and other
typical stuff of course) on the ASP pages (no .NET stuff). Just a shove in
the right direction is all I really need here.

推荐答案

你的数据来源是什么? ?


雷在工作


" MyndPhlyp" <无**** @ homeright.now>在消息中写道

news:%2 *************** @ TK2MSFTNGP14.phx.gbl ...
What''s your data source?

Ray at work

"MyndPhlyp" <no****@homeright.now> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
我''一直试图谷歌这个,但已经得到了太多的命中才能使用。是否有一种灵活的方式来生成CSV或其他Excel友好的格式并将其推送到客户端?我在ASP页面上使用VBScript(以及HTML和其他典型的东西)(没有.NET的东西)。只是推动正确的方向是我真正需要的。
I''ve been trying to Google this but have been getting far too many hits to
be of use. Is there a slick way to generate a CSV or other Excel-friendly
format and push it to the client? I''m using VBScript (and HTML and other
typical stuff of course) on the ASP pages (no .NET stuff). Just a shove in
the right direction is all I really need here.



Response.ContentType =" text /逗号-separated-values"

Response.AddHeader" Content-Disposition"," attachment; filename = extract.csv"


for i = 1 to 10

Next

Response.Write CSVString( 行& CStr(i))& "," &安培; CSVString("第2列")

& vbCrLf

Response.end


函数CSVString(ByVal strIn)

如果IsNull(strIn)则strIn =""

CSVString ="""" &安培;替换(strIn,"""","''")& """"

CSVString =替换(CSVString,vbCrLf,"< cr>")

结束功能

-

- Mark Schupp

" MyndPhlyp" <无**** @ homeright.now>在消息中写道

news:%2 *************** @ TK2MSFTNGP14.phx.gbl ...
Response.ContentType = "text/comma-separated-values"
Response.AddHeader "Content-Disposition","attachment; filename=extract.csv"

For i = 1 to 10

Next
Response.Write CSVString( "row" & CStr(i)) & "," & CSVString("column 2")
& vbCrLf
Response.end

Function CSVString( ByVal strIn )
If IsNull( strIn ) Then strIn = ""
CSVString = """" & Replace(strIn, """", "''") & """"
CSVString = Replace(CSVString, vbCrLf, "<cr>")
End Function

--
--Mark Schupp
"MyndPhlyp" <no****@homeright.now> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
我''一直试图谷歌这个,但已经得到了太多的命中才能使用。是否有一种灵活的方式来生成CSV或其他Excel友好的格式并将其推送到客户端?我在ASP页面上使用VBScript(以及HTML和其他典型的东西)(没有.NET的东西)。只是推动正确的方向是我真正需要的。
I''ve been trying to Google this but have been getting far too many hits to
be of use. Is there a slick way to generate a CSV or other Excel-friendly
format and push it to the client? I''m using VBScript (and HTML and other
typical stuff of course) on the ASP pages (no .NET stuff). Just a shove in
the right direction is all I really need here.



只是查询数据库...写文本文件字符串逐行和

创建文件然后你想用文件系统对象


它很容易实现

" MyndPhlyp" <无**** @ homeright.now>在消息中写道

news:%2 *************** @ TK2MSFTNGP14.phx.gbl ...
just query the database... write the text file string line by line and
create the file however you wan it with the filesystem object

its pretty easy really
"MyndPhlyp" <no****@homeright.now> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
我''一直试图谷歌这个,但已经得到了太多的命中才能使用。是否有一种灵活的方式来生成CSV或其他Excel友好的格式并将其推送到客户端?我在ASP页面上使用VBScript(以及HTML和其他典型的东西)(没有.NET的东西)。只是推动正确的方向是我真正需要的。
I''ve been trying to Google this but have been getting far too many hits to
be of use. Is there a slick way to generate a CSV or other Excel-friendly
format and push it to the client? I''m using VBScript (and HTML and other
typical stuff of course) on the ASP pages (no .NET stuff). Just a shove in
the right direction is all I really need here.



这篇关于光滑的方式为用户下载生成CSV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆