Go Back   Velocity Reviews > Newsgroups > DotNet
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

DotNet - View XLSX file from ASP.NET

 
Thread Tools Search this Thread
Old 09-21-2009, 04:53 PM   #1
Default View XLSX file from ASP.NET


Hi there,
I have web application for viewing document saved in SQL Server 2005 database.
I can retrieve any file type (PDF, XLS, HTML,...) but not XLSX file. When I
try to open the xlsx file, I got the popup window say "Do you want to open or
save this file?" I picked open then popup window with message say Execl found
unreadable
content in 'viewdocument.aspx'. Do you want to recover the contents of this
workbook? If you trust the source of this workbook, click Yes.
I did click Yes then the other window popup say "Excel cannot open the file
'viewdocument.aspx' because the file format or file extension is not valid.
Verify that the file has not been corrupted and that the file extension
matches the format of the file", now only OK button. I click Ok then nothing
happen. We recently installed update for Office. It only happened to excel
2007 (xlsx), I still open excel with ext xls. Below are my coding for xlsx
file
Response.ClearContent()
Response.ClearHeaders()
Response.Clear()
If dr.Read Then
Response.ContentType =
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Response.AddHeader("Content-Disposition", "no-cache")
Response.BinaryWrite(dr("doc_image"))
End If
Response.Flush()
Response.End()

Any advise please. Thanks.


Madison
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
viewstate MAC failed in asp.net 2.0 while postback the page azraffarveen Software 0 05-12-2009 03:24 PM
.NET 2.0 Web Apps / .NET 3.5 ASP.NET Apps - Differences/Similariti london1919 MCTS 1 12-08-2008 03:16 PM
ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) msandlana Software 0 04-25-2008 06:37 AM
ASP.NET deadlock viktoria Software 0 07-05-2007 02:53 AM
ASP.NET 2.0 application does not run in WIN2k3 johnfraj Software 0 04-19-2007 08:27 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46