PC Review


Reply
Thread Tools Rate Thread

CSV incorrect worksheet name when downloaded from web MSIE6

 
 
Gustavo Ortega
Guest
Posts: n/a
 
      13th Nov 2006
Hello,

When I use the follwing aspx code to get a csv file via Internet Explorer in
MS Excel, after comfirm dialog box as "Open content immediately" Excel
displays a corrupt worksheet name as given in:


Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.Charset = ""

....

Response.AppendHeader("content-length", reportOutput.Length.ToString())
Dim type As String = Request.QueryString("Type")
Dim strFileName As String = Request.Params("FileName")

....
Response.ContentType = "application/csv"
Response.AddHeader("Content-Disposition",
String.Format("attachment;filename={0}.CSV ", strFileName))

....

Response.AddHeader("Content-Transfer-Encoding", "binary")
Response.BinaryWrite(reportOutput)
Response.Flush()
Response.End()


then the CSV file opens as:

'.CSV]fille_name[1]'

This worksheet name cannot even be edited to eg. 'table_1'. Excel does not
accept any typing, complaining "wrong characters".

If I write the file to disk instead of opening it in Excel, everything works
fine when I try to open the saved file afterwards.

I don't have a clue on this... however the HTTP headed looks to come back
correctly from the server:

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2006 17:01:31 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
MicrosoftOfficeWebServer: 5.0_Pub
X-AspNet-Version: 2.0.50727
Content-Length: 7092
Content-Disposition: attachment;filename=Data_Export3732.CSV
Content-Transfer-Encoding: binary
Cache-Control: private
Content-Type: application/vnd.ms-excel

Environment:
Server: Windows 2003 Enterprise Server
Client: Windows XP Pro, Windows Server 2003 Server. Using Microsoft Office
2003.


Following the example from this header... the worksheet name will open as
follows in Excel:

..CSV]Data_Export3732(1)



Thanks for any guide...


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet formula incorrect after copying to another worksheet Karen Microsoft Excel Worksheet Functions 2 12th Nov 2009 01:06 AM
Incorrect numer of e-mails downloaded by Outlook 2003 from Yahoo =?Utf-8?B?c3pwb3Rp?= Microsoft Outlook Discussion 0 9th Sep 2007 01:00 PM
CSV incorrect worksheet name when downloaded from web Gustavo Ortega Microsoft Excel Discussion 0 13th Nov 2006 05:13 PM
CSV incorrect worksheet name when downloaded from web MSIE6 Gustavo Ortega Microsoft Excel Discussion 0 9th Nov 2006 08:50 PM
Hyperlink when downloaded to Server Is Incorrect, Help!! =?Utf-8?B?TGluZGE=?= Microsoft Frontpage 9 3rd Oct 2005 02:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:12 AM.