Wednesday, October 3, 2012

SharePoint 2013: Document Library and Search Results Document Preview with Office Web Apps Server


Check out the whole SharePoint 2013 Solution Series
New Titles Added Weekly!

I kept reading that if you have Office Web Apps Server up and running, you can connect it to your SharePoint farm and then, automagically, document previews will start appearing both in Search and in Document Libraries. I have not found any examples of what this document preview looks like so I had to take matters into my own hands.

I finally installed Office Web Apps Server on one of our staging servers and connected it to a SharePoint 2013 farm in stage. After some warming up, the document previews for Office documents started working like a charm. For the Search Results, I needed to run a full crawl again. This is because the javascript in the Display Templates uses alternate URLs (defined by crawled properties) which take the Office Web Apps server and the document preview into consideration.

I essentially followed the steps here: http://technet.microsoft.com/en-us/library/jj219455(v=office.15).aspx and used the standalone test environment section using Internal HTTP. I have some screenshots of the steps so I will probably post my installation journey as well. (UPDATE: The installation post is here.)

However, I was so excited that the Office document preview worked that I wanted to share the results. Below are some screenshots.

Search Results - Hovering over a Word document (click image to enlarge)




Document Library - Selecting the elipsis (...) on a Word document library item (click image to enlarge)
 
The previews under Office Web Apps server is only for Microsoft Office documents. Therefore PDF previews do not render. However, at least for the search results, I have a PDF Preview solution.

 

The document preview is the "cool" part about Office Web Apps server but not the business value part. The business value is the ability to edit and work with Office documents in the browser without the need for local Office applications.

What does this mean? This means that business users may interact with Office documents through SharePoint directly in the browser on any device. So whether it is a laptop, desktop, smart phone, or iPad - there are no constraints in making those last minute edits.


 

17 comments:

  1. Hi Steve, thanks for this great post, saved me a bunch of time.. Would you happen to know if file preview is supported for BCS search? I have external content that I am crawling through BCS, and the file preview does not work in the search results. However, file preview works for sharepoint content.

    ReplyDelete
    Replies
    1. You need to create a new search Result Type that was for your BCS results and then create a search Display Template for that Result Type. I'll eventually be doing this and will probably post about it but it may be awhile.

      Delete
    2. Hi Steve,

      Thanks for your reply.

      The issue is, for file preview, the WOPI host looks for files in the current context of Site collection prior to making the request to the office web app server. So the url that gets passed is something like this:

      “http://servername1/sites/teamsite/_layouts/15/WopiFrame.aspx?sourcedoc=/sites/teamsite/Shared Documents/test.txt&action=view”

      So if I were to give something like (where sourcedoc parameter points to a different server):

      http://servername1/sites/search/_layouts/15/WopiFrame.aspx?sourcedoc=http://servername2/GetFile?filename=test.txt&action=view

      it fails as it tries to locate the file in the current site collection and a FileNotFound exception is thrown.

      In my scenario, the file source is not a SharePoint list. The file is exposed to SharePoint search via custom connector.
      Do you think I will have to implement a custom WOPIframe helper or is there a different way/work around in the SharePoint search framework to achieve this?

      Delete
    3. I would try to create result types for these "external files" based on the search content source and then attempt to construct the appropriate Url in custom hover panels (display templates). That may be the easiest and most maintainable.

      Delete
    4. Would WopiFrame2.aspx instead of WopiFrame.aspx work? This fixed one of our issues, may work for you too. See http://www.wictorwilen.se/an-explanation-to-to-start-seeing-previews-please-log-on-by-opening-the-document-in-sharepoint-2013

      Delete
  2. Dear Steve,
    As you mentioned the solution the above last comment, would it be possible to have more information of implementation of this solution or you may provide some link from other website?

    Thanks in advance.

    ReplyDelete
    Replies
    1. I can provide an example of creating custom result types and custom hover panels. I'll keep you posted.

      Delete
    2. Looking at the WOPI call in the previos comment with the custom connector, since the sourcedoc doesn't point to an actual file, it won't work.

      Delete
  3. Would it be possible to serve external server document via locally hosted page so that Web Apps Office Server consider it local document rather than external file share content source.

    Just an idea !!

    ReplyDelete
  4. Hi Steve,

    Can you answer my question http://sharepoint.stackexchange.com/q/76136/13391

    Please help me out.

    Regards
    Mani

    ReplyDelete
    Replies
    1. The guy that answered is correct. You need Office Web Apps Server 2013 installed and running on a separate server.

      Delete
  5. hi i have a document library in sharepoint 2013
    When i search a file/document in that document library it shows no results
    Could please tell me how to configure the search

    ReplyDelete
    Replies
    1. Sorry for the late response. I had midterms and team project work for school. There are several factors that affect content being indexed or returned. Make sure the document library setting is set to allow the content to appear in search results. There is also a setting at the site collection (or site) level. I always use the SharePoint 2013 Search Query Tool to troubleshoot any lack of results. It is a free download! https://sp2013searchtool.codeplex.com/

      Delete
  6. I am unable to display a hover preview for older Excel files (.XLS) even though there's an entry in the WopiBindings and I am able to view the files in the browser. Is there any official say if this file format is unsupported? or any additional configuration needed? The same is happening for PDF files in document libraries, which I presume requires extra steps to configure..

    it would be good to know what files/formats are and are not supported, and what extra steps may be available for each. any clarification / help on this greatly appreciated!

    ReplyDelete
  7. Hi Steve, we have successfully been using the customized search display templates for PDF files for a couple years on our on-premises 2013 farm. We recently applied a SharePoint January 2016 CU and our template isn't working now.

    I tried resetting the files back to the Site Definition and customizing the templates again but that didn't work. Do you have any suggestions? Thanks!

    ReplyDelete
    Replies
    1. I would use the browser tools to debug the Item template and see if there are any errors.

      Delete
  8. I like the valuable information you provide in your articles.

    I will bookmark your blog and check again here frequently.
    I'm quite sure I'll learn many new stuff right here!
    Good luck for the next!

    ReplyDelete

Matched Content