Dear friends,

Hope all of U are having a great time.
I need to display Excel sheets online using asp.net ,C#, MS SQL and Microsoft Office Share Point Server 2007. I need to make this Excel sheet editable to some authorized users. Do anyone of you have idea of attaining this scenario. Please respond if you have any hints make this possible. Thanking you in anticipation.
Vamsi K Gummadi

9 Years
Discussion Span
Last Post by vamsikgummadi

there are some free components available that allow you to view excel documents in asp.net i cant think for the love of god where i saw them tho. best to GOOGLE it. Another alternative is to use something like a datagrid and create your own excel like application. this way you would have full control over everthing as youve hand made it.


Hello Mr.Fungus,
Thank you for the reply and the suggestion. Yes, I agree with you that I can make use of something like a datagrid and create my own wxcel application and have full control on it. But my requirement is demanding me to display excel sheet online and make it editable to authorized users. Actually I tried to attain the above said scenario using IIS, asp.net, C# and MS Excel and I am partially successful. I am able to display excel sheets online but unable to edit, add and update. Even if I am edit the excel sheet displayed online it is saving the updated or edited file in some other location.
So my requirement needs excel sheet displayed online and make it editable to authorized users and at the same time save the updated file in the same location where the actual file exists.
I have googled to acheive this problem and I have learnt that using MS Office Share Point Server 2007 I can acheive this problem. Now, I request youand all the members in daniweb.com to suggest how I attain the problem using SharePoint Server, asp.net, c# and MS Excel. Hope you all enjoy taking this problem as a challenge and solve this problem together.
Vamsi K Gummadi.
United we stand divided we fall. We can make things better by working together.


I don't know that it'd be the most efficient, but you could save the Excel document as XML and use that as a data source on your website. You could then set up permissions to edit the XML data through a web interface. Like I said, this might not be the best way, but it should be functional.


Hello friends,Thank you for the replies and suggestions. Yes as some of you have suggested I have also tried to use Google spread sheets which are similar to MS Excel but my requirement is demanding me display MS Excel spreadsheets online.Yes I can save the Excel document as XML and use that as a data source on my website. But I don't know how to manage permissions. If I am editing the excel sheet that is displayed online and trying to save it then it is saving in some other location instead of updating the file in the same location.So for this purpose some of my friends are suggesting me to use Microsoft Share Point Services 2007.So I request you to kindly guide me how to manage perrmissions while displaying excel sheets online and save it in the same location or how to use Microsoft Office Share Point Server 2007 to display Excel Sheets online using C#,asp.net. Hope I am clear with my problem.I will be very greatful if you can help me in this aspect.VamsiKGummadi


the way i did it was not through sharepoint server but through owc (office web components)
the coding for it it is quite easy and i could show you some exact code snippets if you're interested in
I've used asp.net 2.0 with c#; another thing you need to know is what owc you want to use (coding can be a little bit different); i have used owc11 (the office web components for office 11 (office 2003));
you also need to have the actual office installed on the server;
displaying real excel spreadsheets in web pages it is not too recommended because for each spreadsheet shown an office instance is running on the server;
anyway if this is what you want just post a reply and I'll give you the actual samples


Hello Sir,
Have gone through your reply. I think the solution you have given will be useful to me. Yes I agree with you that displaying real excel spreadsheets in the web pages is not advisible. I want these excel spreadsheets to be viewable to all users and editable only to authorized users.
I have actual office installed on the server. I am also having asp.net 2.0 installed.So, please kindly forward me the exact code snippets and any other links that can help me to find out a solution for this problem. Hope you will do the necessary.
Vamsi K Gummadi.
Ideal brain work like a devil


snapshot from spreadsheet.aspx.cs

using Microsoft.Office.Interop.Owc11;


public string SSxml;

inside a method of yours or in page_load:

SpreadsheetClass spsh = new SpreadsheetClass();

... //you do here whatever you want with this spreadsheet (here is where you have to load it from file using obj spsh exposed methods)
//you can do loads of things with this obj through its methods

SSxml = spsh.XMLData; //at the end you set this var in order to actually have it in the webpage

the other part is spreadsheet.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="spreadsheet.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <form id="form1" runat="server">
		<object id="spreadsheet1" classid="clsid:0002E559-0000-0000-C000-000000000046" width="1000" height="700">
			<param name="XMLData" value='<%= SSxml %>' />

i hope you understand all the things above

have a nice day

you can google for "SpreadsheetClass" to find more details


Hello Sir,
Thank you for the help. I will work in this aspect and get back to you if I have any doubts. Thank you for the support offered. I will let you know the details at the earliest.
Vamsi K Gummadi.
Working hard is the only key of success.


Hello Sir,
Hope you are having a nice time.
I have used the code snippets that you have forwarded and found that it is working fine. I have made some changes in. aspx code that you have forwarded as per my requirement.
Now I am able to display Excel sheet online but I am unable to view 'Insert function' icon in the spread sheet that is being displayed online.
As per my requirement I need the 'Insert Function' option to be displayed in the tool bar of the excel sheet that is bieng displayed. I need this option because I need to have some caluculated columns in the Excel sheet being displayed.
Please suggest me how to attain this scenario. Hope I am clear with my explanation. Please get back to me if you need further clarification to help me in solving this problem.
I once again thank you for your help extended in solving this problem.
Vamsi K Gummadi.

Step by step working together we can be ahead.


Dear Friends,

Hope all of you are having a nice time.
I am herewith attaching a file to you all so that you all can
analyse and help me to sort out the problem I have
discussed with you all earlier.

Using Office Web Components I am able to display data
in the form of Excel sheets by querying SQL server
database tables using C#, asp.net.

Now my requirement is

1. I should be able to edit data that is displayed
on-line in the form of Excel sheets. I must be able to
edit the data in the excel sheet and save the changes
made into the SQL server database tables (from where
the data was retrieved earlier).

(we can try for this requirement later once the first
requirement is achieved)
2. I should be able to grant different levels of
access privileges to different users.

Hope I am clear with my explanation. Please suggest me
how to attain this scenario. Also provide me with code
snippets if possible. Hope to get feedback from you all at
the earliest.

Vamsi K Gummadi.


Hello friends,
Thank you all for your support . I have found out an alternate solution to solve this problem. We have used third party datagrid tool developed by 'Aspose' which exactly matches to the requirement I have been asking for. Even the problem is being marked as solved right now there should be an alternative to do this and so I request you all to debug into this problem and come out with various solutions possible.
Vamsi K Gummadi.
' A heathy day is a wealthy day'


The replies to be honest are not very convincing...its good if you are using windows hosting server.. if on linux server..how do u manage the same scenario...it becomes difficult.

Any suggestions for Linux Hosters....


Hello friends,
The thing is that I don't know if MS VISUAL STUDIO can be installed on LINUX or not. I think it cannot be installed as per my study of software and hardware requirements . Evev if it works out it would be difficult to get scientific calculation in a data grid. So in my project I have used spose data grid a third party tool and solved the problem. Some friends mentioned to use office web components , some suggested to use share point server as a whole, some said to use self defined data grids.... All these suggestions are very helpful because I came to know what is what?. This forum is providing all the hints we require for our daily work. Thanks to moderators, members and all my friends who have participated in this thread.
Vamsi K Gummadi.

This question has already been answered. Start a new discussion instead.
Be sure to adhere to our posting rules.