Reputation: 7555
I have an ASP.NET web application hosted on Azure for use internally by our company. On this site, I keep a few spreadsheets and word documents that I would like employees of the company to be able to click on, and have them open directly in Microsoft's Office Web Apps where they can view and edit them. This is very similar to being logged in to SkyDrive and clicking on the file. Here is what I'm looking for:
Requirements:
The user should be able to edit the documents directly in their browser and save them.
My ASP.NET web application should be able to obtain a list of the documents and display them.
My ASP.NET web application should be able to allow users to upload new documents
The user should not have to login more than once (i.e., they should only have to login to our internal ASP.NET web application).
What I've tried: I cannot seem to figure out how to do this though, here are a couple things I've thought of and tried.
Using SkyDrive + API: Keeping the documents in SkyDrive, sharing them across employees, and using the SkyDrive/Live API to log them in and open the documents. This doesn't work for us because SkyDrive does not allow you to share documents without making them completely public (i.e., anyone with the link can view/edit them). They must be kept internally.
Using SkyDrive Pro: SkyDrive pro has the benefit of better sharing credentials. You can share something with a particular user, and only that user (i.e., they need to be logged in to view/edit it). Unfortunately, SkyDrive Pro is not supported in the Live API so I cannot access the files directly from my ASP.NET application.
Sharepoint: I think a possibility is SharePoint by keeping the documents in a Document Library and a using SharePoint Client. I think I can specify user credentials to obtain a list of documents in the Document Library, but I'm not sure that I can "open" one of those documents in the Office Web within their without bothering them to login to the SharePoint site again, and again. Especially if their own personal login times out? I have to re-enter my SharePoint password constantly using SharePoint in my browser, I do not want this when integrating with our ASP.NET app.
It would be great if Microsoft integrated the Office Web Apps in to Azure, potentially allowing you to open Excel and Word documents stored in Blob Storage. But that's not possible.
Anyone have any other ideas?
Upvotes: 12
Views: 10468
Reputation: 916
You can definitely use Office Web Apps for this. First, you have to have an Office Web Apps farm. Second, you need to implement the WOPI interface. There are code samples and github references on this msdn blog.
https://blogs.msdn.microsoft.com/apulliam/2016/06/19/wopi-framework/
WOPI Framework only supports ASP.NET WOPI Servers. The WOPI Framework is mainly just a set of C# classes to simplify WOPI Server programming and encapsulate the protocol complexities. The same approach could be used to deliver a WOPI Framework for other development platforms, such as Node.js.
Upvotes: 0
Reputation: 9300
If the mentioned SkyDrive/Office365 API cannot be used, I believe it is possible to implement such a functionality with the use of 3-rd party libraries (Aspose, DevExpress, etc.) intended for office-like document processing + visualizers (free or commercial analogs).
Check:
Upvotes: 0
Reputation: 126
Take a look at Office Web Apps and in particular the section on deploying the Office Web Apps Server.
At the bottom of the overview page it states:
Office Web Apps Server provides a page at the address
http://OfficeWebAppsServername/op/generate.aspx
that you can use to generate links to publicly available documents that have UNC or URL addresses. When a user selects a generated URL, Online Viewers enable Office Web Apps Server to get the file from its location and then render it by using Office Web Apps.
Upvotes: 1
Reputation: 3752
This is an old technology, and it only works in Internet explorer, but I think it is elegant in the way it works. Notice it is deprecated.
You start by installing Office Web Components OWC, a google search should give you that. Then for spreadsheets you add an object like this
<object classid="clsid:0002E551-0000-0000-C000-000000000046" id="Spreadsheet1" width="1100" height="900">
<param name="DataType" value="XMLURL" />
<param name="AllowPropertyToolbox" value="1" />
<param name="AutoFit" value="1" />
<param name="CalculationPoco" value="-4105" />
<param name="Caption" value="" />
<param name="DisplayColumnHeadings" value="0" />
<param name="DisplayGridlines" value="-1" />
<param name="DisplayHorizontalScrollBar" value="1" />
<param name="DisplayOfficeLogo" value="0" />
<param name="DisplayPropertyToolbox" value="0" />
<param name="DisplayRowHeadings" value="0" />
<param name="DisplayTitleBar" value="1" />
<param name="DisplayToolbar" value="0" />
<param name="DisplayVerticalScrollBar" value="-1" />
<param name="DisplayWorkbookTabs" value="1" />
<param name="EnableEvents" value="-1" />
<param name="MaxHeight" value="90%" />
<param name="MaxWidth" value="90%" />
<param name="MoveAfterReturn" value="-1" />
<param name="MoveAfterReturnDirection" value="-4121" />
<param name="RightToLeft" value="0" />
<param name="ScreenUpdating" value="1" />
<param name="EnableUndo" value="1" />
<p>OWC required.</p>
</object>
And then you can get the object via javascript and manipulate values to and from a database, or whatever you want.
exlObj = document.all.Spreadsheet1;
exlObj.XMLURL ="/Excel/Whatever.xml";
exlObj.ActiveSheet.Unprotect();
exlObj.Range('Sheet1!$A1').Value = 5;
Notice that when you set the xml-url then you have to have the excel saved in a 2003 xml format. I wonder if it exits as a new technology.
But it is deprecated etc. So I guess a more pure solution also must exist.
Upvotes: 2
Reputation: 1487
tl;dr Google Apps/Drive.
Google Drive allows you edit and save documents directly from the browser.
Google Apps provides an API for Google Drive (Also for .NET
), so you can obtain a list of the documents, display them and allow users upload new documents.
You can manage service accounts owned by your app. you can use openID / SSO, so the user wouldn't have to login more than once.
The disadvantage is that documents in GDrive not exactly same as in MS office.
Upvotes: 0