Re: How to Display ms office files in asp.net? Hi.. Here is the answer for your question
You can display office files by changing the content type of the response object when sending data back to the client. For example, the following will change the content type to Excel. A search on google will give you the necessary content types for other office file formats.
response.ContentType = "application/x-msexcel"
response.AddHeader "content-disposition", "inline; filename=Report.xls"
As for creating new office files, this is a lot trickier and it really depends on the types of office files that you want to create. While all office products have underlying Object models that allow you to programmatically create and manipulate office documents, they are not designed for working over the web and can seriously affect the performance of your web applications. You might want to look into Office Web Components but this will not really help you if you are thinking of creating Word or Powerpoint documents. There are however a lot of third party tools out there that will give you the ability to create and manipulate Office documents. One such provider that I have used extensively is aspose who offer a tool for all Office products and others too |