torsdag 29. januar 2009

Excel Web Parts (Without MOSS/Excel Services)

Get Full Excel 2007 web part access without Excel Services.
Plus learn how to create your own preview pane from search results.

Business Case:

Using SharePoint to indexing oracle, exchange server, file store, sharepoint areas proves really useful, further more searching on the material is superb. However one area that I noted was that as the search results grow so did the time it took a user to locate the correct document. Especially if they were having to open and close mutiple documents, websites, lists etc...

The preview pane is a webpart that again uses the CEWP, IFRAME, REGISTERY settings to display (on mouse over in mycase) the search result.

After following on from the last blog about previewing office documents I though i would show you a nifty way of doing this from a Search Result. I am using MOSS Enterprise here hence the search results pages are looking like they came from a Enterprise tempalte (becuase they did)... But you can easily modify this to work with WSS 3.0 or MOSS standard.

What you can see above is a search result (with some additional webparts for filtering...Facted Search on codeplex if you want) then Ive added a content editor webpart which emulates a IFRAME.

To finish it all of we simply edit the XSLT to send a row of data (i.e the path) to the Iframe. In between this we must edit the registery to accept these things.

Part 1:

Open notepad and past the following into it.

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.Document.8]"BrowserFlags"=dword:80000024[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.RTF.8]"BrowserFlags"=dword:80000024[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.Document.12]"BrowserFlags"=dword:80000024[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.DocumentMacroEnabled.12]"BrowserFlags"=dword:80000024[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Sheet.8]"BrowserFlags"=dword:80000A00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Sheet.12]"BrowserFlags"=dword:80000A00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.SheetMacroEnabled.12]"BrowserFlags"=dword:80000A00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.SheetBinaryMacroEnabled.12]"BrowserFlags"=dword:80000A00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.Show.8]"BrowserFlags"=dword:800000A0[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.Show.12]"BrowserFlags"=dword:800000A0[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.ShowMacroEnabled.12]"BrowserFlags"=dword:800000A0[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.SlideShow.8]"BrowserFlags"=dword:800000A0[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.SlideShow.12]"BrowserFlags"=dword:800000A0[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.SlideShowMacroEnabled.12]"BrowserFlags"=dword:800000A0

Save as AnyGivenFileName.reg

* note you must consider business related needs when openning Office documents in the browser!

Then double click your newly created file and it will add the registery settings so that Office documents can be opened in the browesr (including full ribbon support! :)

Part 2: Now go over to your Sharepoint Search results page.

Edit the core results and pull up its XSLT. I prefer using Visual Studio to edit XSLT AND XML but it doesnt matter.


span class = "srch-Title"

Add the following to the a href link parameters:

In the above case it will react to the mouse over event, but if you dont want that then just omitt.
Copy the XSLT from your editor, then past it back into the Core Results webpart XSLT.

Part 3:
Add the content editor webpart to your search results page (I prefer in the right webpart zone) and you probably want to give it a fixed width and height.

Add a IFRAME Snippt named "myframe" (same as XSLT above ref essentially) to a CEWP.
See bellow in previous blogg if your not sure how to add a IFRAME to the CEWP.

Then perform a search results hover over the title and it will load it in side your webpart previewer.

With Excel, Word you will get full ribbon control so on so forth....So you can take this principle and use it for Excel Web Access should you want to.


James Bruiners

1 kommentar:

  1. I have many children. But once one of them spoiled my computer. I wanted to kill him. But I could use my knowledge to resolve this trouble. I worked out my issue with the aid of a tool, which I was found on an one soft forum. Moreover to my great surprise the software could be usable for solving similar comlicated conditions - Microsoft Excel repair tool.