Displaying an Excel spreadsheet

T

Tim Marsden

Hi

I am a complete ASP novice.
Is it possible to display an Excel spreadsheet in a web page?
Can any input to the sheet be captured and sent back to the server?

Regards
Tim
 
C

Curt_C [MVP]

Yes you can display it, as long as the client has Excel installed. Just
redirect/point them to it.
As for editing...that's another story. It's a matter of permissions and
that. I HIGHLY recommend you rethink that.
 
T

Tim Marsden

Thanks

Is it possible to display the Excel Workbook, if the user does not have
Excel installed.

Tim
 
S

S. Justin Gengo

Tim I've done this by sending a datagrid through with appropriate headers.

Here's some sample code to get you started:

Datagrid1.DataSource = MyDataSet
Datagrid1.DataBind()

Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False

Dim MyStringWriter As New System.IO.StringWriter
Dim MyHtmlTextWriter As New System.Web.UI.HtmlTextWriter(MyStringWriter)

Datagrid1.RenderControl(MyHtmlTextWriter)
Response.Write(MyStringWriter.ToString())



--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top