torsdag 29. januar 2009

Preview of Risk Anlaysis (Monte Carlo & Historic) using Excel 2007 in the Elite 3 Framework.

<br/><a href="" target="_new" title="Elite 3 - Aldersfordelt Report Risk analysis">Video: Elite 3 - Aldersfordelt Report Risk analysis</a>

My Video's

Preview of Elite 3 Excel - PowerPoint Intergration:

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

mandag 5. januar 2009

Document Viewer Webpart MOSS

Office 2007 Document Viewer WebPart (No code required)

The business case was that we had a few large lists that had documents from Office 2007. The problem was the amount of time it took to open each document then preview it in a new instance of the Office application (if you computer is having a slow day this means a lot of wasted time) and then if it was incorrect you would have to open a new one and start the whole process again.

So what if we could preview Office documents like shown bellow.

All we have here is a list and when you click one of the hyperlinks it will open the document in the preview webpart bellow :) Nice....

Step one goto your sharepoint server:

Open Explorer
Click Tools
Click Folder Options (at the bottom)
Click "File types" tab - it will then populate your file types registered on the server.
Go down to DOCX

Now click the advanced button and
you will get some windows.

No select the tick box Browse in same window! Click ok a few times.

* I wouldnt recommend you play around with much of these settings especially the DDE messaging unless you really know what you are doing! But openning in same browser is ok...

Restart internet explorer.

Now create a document library you want to store you Documents into. If you already have one then you can use this, however I would recommend creating a fresh one for testing first.

Upload a few documents to the document library. In this case Word 2007 files.

Now edit the page where the document library is shown, click site settings, edit page.

Here you can add a webpart to the page, if you want to create a seperate web part page and add the document library to that you could of course....

Add the Content editor webpart to the page. I prefere underneath.

In the source editor add the IFRAME snippet found on the image to the left.

Click apply and ok.

It you have publishing features activated the checkin any changes and exit edit mode on the page. Take a copy of the URL of the page.

Now open SharePoint Designer and open the page which contains your list and newly added Content editor webpart with its IFRAME inside it....

We will be converting the standard list to a data view if your not sure how to do this, click insert, sharepoint controls and then select dataview, you can choose the document library of your choice, in our demo the one above.

There will be a little right arrow (small) to the top right of the data view, by the way you can easily modify the XSL here to make things like sorting, filter, grouping....but today we are more interested in changing a field type so it is a hyperlink.

To do this simply click this arrow icon and select edit Colomns, make sure you add the hyperlink field and remove any unwanted fields also.

Now select the top record (i.e the hyperlink field) in the data view we have just created. like shown bellow, there is a similar arround icon that will show:

Make sure the URL path is shown on the field, you can mask this is you want to in Java Script or indeed in XSD but here is just simply for demo purposes.

Save the page and exit SPD.

Go back to the page in SharePoint and edit the page once again. Modify the data view webpart and modify the XSL.

Find the XSL when test for the field type 'url'
it might look something like this.

xsl:when test="$fieldtype='url'

underneath this there should be a "a href" after the "{$fieldvalue} tr" simply add the following:

a href="{$fieldvalue} tr" target="myframe"

Now what we have is a hyperlink the will send the full url path to the IFRAME we created in the Content editor webpart.
Save, apply and ok. Then youre ready to go

James Bruiners

Sharepoint & Office Business Application development

Happy 2009 -

My name is James Bruiners I am the Snr. Microsoft Office SharePoint Server consultant and Microsoft Office Business Applications consultant for a Norwegian energies company.

I decided to start this blog after my many development highs and lows surrounding SharePoint and Office 2007.

I will be updating a number of business case articles with sample code, video and explanation surrounding how to maximize MOSS & Office 2007.

Some of the main areas will include:
BDC Development
Enterprise Search
Content Management
Office 2007 xml
Office 2007 VBA
VSTO Application Addins
VSTO Document Level Addins
Best Practices
Web Parts
WPF/E Intergration
Forms Server & Services
InfoPath VSTO development
Excel Services
Risk Analysis
Oracle intergration with MOSS
VB6 Integrations with WSS 3.0
and so on....

So keep watching for more useful information and hints.