Click here to Skip to main content
16,007,885 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a requirement to create a web application where user will be able to view and edit MS Excel/Doc files directly in web browser without having installed MS office on his machine. MS office would be installed on only server where this application will be hosted. Please suggest the appropriate solution using C# and asp.net.
Posted
Comments
Kornfeld Eliyahu Peter 2-Sep-14 15:37pm    
Good luck with that...I hope you payed well for writing Office in JavaScript...
Sergey Alexandrovich Kryukov 2-Sep-14 15:41pm    
:-)

1 solution

Browsers are not supposed to support this proprietary format. Even if you want your solution to be based on the MS Office format (which I would not recommend, but many sites to exactly that), you would need to define some mapping between some class of documents and HTML, represent the document as HTML, and provide the editing capabilities through editable HTML. When the document is updated by the user, you can convert it back to Office format using the mapping your defined.

Editable HTML can be based on this feature:
HTML
<div contenteditable="true">
   <p>Some initial content, optional...</p>
</div>


If you add this fragment on your HTML page, the user will be able to edit it; and you will need to add formatting controls to such "editor".
Please see:
http://www.w3.org/TR/2008/WD-html5-20080610/editing.html[^] (see 5.2),
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable[^].

There are many dedicated Javascript-based HTML editors you can use. Please see:
http://en.wikipedia.org/wiki/HTML_editor#WYSIWYG_HTML_editors[^],
http://en.wikipedia.org/wiki/HTML_editor#Online_editors[^].

—SA
 
Share this answer
 
Comments
Raj_3 3-Sep-14 14:03pm    
Hi SA,

Thanks for your reply.

I will have a look at the solution you suggested.

-Raj
Sergey Alexandrovich Kryukov 3-Sep-14 16:24pm    
Great. Do you plan to accept the answer formally (green "Accept" button")? Unfortunately, we don't have resources to provide one complete solution for you. In principle, you now have all you need to do the job, which is not exactly easy.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900