dmouser

I am tryeing to save recordset result in csv file ...but getting error INternet explorer can not download xxx.asp from localhost.Internet Explorer was not able to open this internet site. the requested site is either unavailable or can not be found please try again later. ReturnResult functions returns comma delimited string .

My code is as Follows

dim CurrReportName:CurrReportName=server.MapPath ("HistorianReport.csv")

Response.Clear

Response.Buffer = true

Response.ContentType = "text/csv"

Response.AddHeader "Content-Disposition", "attachment;filename=" & CurrReportName& ";"

response.Write(ReturnResult())

response.End

Thanks



Re: Internet Explorer Web Development Save Recordset to CSv File

Ryan Lamansky

You're getting the error because no data is being sent to the browser.

You have to Response.Write the entire CSV file.

-Ryan / Kardax





Re: Internet Explorer Web Development Save Recordset to CSv File

dmouser

Thanks for your reply.... I am confused about Content Disposition ... Does it just force to open a save dialog I wanted to export dynamically created data to csv.... CSV file Does not exist on the server....... So I am writing Recordset results using that display result function...





Re: Internet Explorer Web Development Save Recordset to CSv File

Ryan Lamansky

Content Disposition: Attachment normally does force the save file dialog, but in order for it to have something to save, you must Response.Write the CSV data. Additionally, your "filename" should not be the server path, just use the plain HistorianReport.csv name.

-Ryan / Kardax





Re: Internet Explorer Web Development Save Recordset to CSv File

dmouser

' check the report owner
dim CurrReportName:CurrReportName="Report.csv"
' write out the file
Response.Clear
Response.Buffer = true
Response.ContentType = "text/csv"
Response.AddHeader "Content-Disposition", "attachment;filename=" & CurrReportName& ";"
response.Write(DisplayActivityReport())
response.End


I am getting the error Internet Explorer can not download XXX.asp from Localhost .IE was not able to open this Internet site .The requested site is either unavailable or can not be found.


Thanks




Re: Internet Explorer Web Development Save Recordset to CSv File

dmouser

Problem solved... removed include files from asp page.... it works now