Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download and display excel spread sheet within the browser

Tags:

c#

asp.net

Need to navigate to Excel spread sheet and display in the browser. how could I do that ?

like image 233
TonyP Avatar asked Feb 14 '10 10:02

TonyP


2 Answers

I think you dont want to convert the Excel in DataTable if right why dont you use google docs to display your document here are some links

http://docs.google.com/viewer

http://code.google.com/apis/documents/overview.html

http://code.google.com/apis/spreadsheets/

Thanks

like image 97
Shakeeb Ahmed Avatar answered Nov 03 '22 20:11

Shakeeb Ahmed


the 2 verbs 'navigate to' and 'display in' are not going to work here. even if the user wanted to and agreed to any dialog that was popped by the os, I assure you that the browser is not the registered applicaion for excel.

To get a browser to display an .xls inline you have to render it to the response and set the content-disposition header to inline.

someone else just posted a link to an article that can get you started, just change the content-disposition to 'inline'.

like image 24
Sky Sanders Avatar answered Nov 03 '22 18:11

Sky Sanders