iamnobody
iamnobody

Reputation: 666

Preview or Embed on a web page an Excel document stored in Azure Blob

I was wondering if it is possible to open an Excel file (or any Office file) stored on an Azure Blob account within a browser or, better yet, embedded on a web page. Kind of like a preview function instead of always prompting the user to download the file. I know this could be easily done by storing the file in Sharepoint or OneDrive and using it's embed functionality but I'm trying to steer clear of those since we already implement the blob storage.

I've been searching but most results only lead me to Sharepoint/OneDrive.

Any help would be appreciated. :)

Edit (2014-07-14)

As per RGregg's suggestion below, I tried looking into creating a custom WOPI Host and I do think it would perfectly fit what I need. But I think I'm missing something. I cannot get the preview running. I am always getting a "Server not found" error. I tried replacing the old discovery file directed at owa1.wingtip.com with officeapps.live.com/hosting/discovery and it now goes as far as the loading image of Word Online but it gets stuck there. Couldn't really find other materials that expounds on how to make it work and it doesn't show any error whatsoever.

I also tried to create my own (in an attempt to simplify everything with just the mere basics) by implementing the GetFile and CheckFileInfo methods required. It sucessfully retrieves the file and the info but I still can't integrate it with the Web Apps. I think I'm missing a big chunk of something but I can't really figure it out. :(

Upvotes: 0

Views: 3321

Answers (2)

iamnobody
iamnobody

Reputation: 666

I've just recently found out about Google Doc Preview. Basically, you'll just need an online URL of your document and appended it to:

https://docs.google.com/viewer?url=

and put that in an iframe. For wholeness:

<iframe src="http://docs.google.com/viewer?url=http://<blobServer>/<filename>&embedded=true" width="600" height="780" style="border: none;"></iframe>

It already provides some sort of a "Print Preview" on an IFrame so you have to keep in mind of pagination when creating the document for a prettier view. It also doesn't require you to have any google account to access it.

I still have some issues with it though:

  1. Security. No required account = less security.
  2. Doesn't render charts well. I had a pie chart and it appears as one whole solid circle.
  3. Doesn't render filters at all thus...
  4. Doesn't provide interactivity unlike OneDrive's embed.

But, this still answers the question so I'm posting it here for anyone looking for a solution. :)

Any answers are still welcome. :)

Upvotes: 1

Ryan Gregg
Ryan Gregg

Reputation: 2035

I think it'd be easier to convert your backend over to Office 365 or OneDrive than to make your blob storage solution work with the Office apps, but I think what you would need to do is implement a WOPI host, like in this article: http://code.msdn.microsoft.com/office/Building-an-Office-Web-f98650d6. That would at least get you to a point where Excel Web App could load files from your blob storage.

Upvotes: 1

Related Questions