SharePoint Events

  5/13/2013 - Conference: SharePoint Summit 2013
  5/21/2013 - Webcast: SharePoint 2013 and ECM: Content Migration and Storage
  5/22/2013 - Webcast: Managing CAD in SharePoint
  5/23/2013 - Webcast: SharePoint Document Automation and E-Forms for Financial Services
  5/24/2013 - Webcast: What's New in Search for SharePoint 2013

 SharePoint Videos

  Why SharePoint 2013
  SharePoint 2013 Launch
  SharePoint 2013 Migration and Governance
  SharePoint 2013 and Enterprise Content Management
  Top Benefits of SharePoint 2013
  What's New in Business Intelligence in Office and SharePoint 2013
  SharePoint and Office 2013 Integration
  SharePoint 2013 Infrastructure Preview
  SharePoint, Lync, and, Exchange in the Cloud with Office 365
  Advanced Reporting in SharePoint with Microsoft Power View

 Archives

Opening SharePoint Links in a new windowUse SHIFT+ENTER to open the menu (new window).
Mail Enabled Lists vs. The Missing Windows 2008 POP3/IMAP Server Use SHIFT+ENTER to open the menu (new window).
7 Tools for SharePoint DevelopersUse SHIFT+ENTER to open the menu (new window).
Public Facing Masterpage TechniquesUse SHIFT+ENTER to open the menu (new window).
How to Quickly Deploy and Activate a Timer Service to Your Site CollectionUse SHIFT+ENTER to open the menu (new window).
Custom SharePoint Master Page Feature with WSP BuilderUse SHIFT+ENTER to open the menu (new window).
Date Math with InfoPathUse SHIFT+ENTER to open the menu (new window).
Enterprise Search Tricks and Tips Part 1Use SHIFT+ENTER to open the menu (new window).
Populating Word Documents With SharePoint Data. Try The DIP!Use SHIFT+ENTER to open the menu (new window).
Programmatic Deep Dive into Blank SharePoint Lookup ColumnsUse SHIFT+ENTER to open the menu (new window).
1 - 10 Next
Adventures in Excel Services 2010

By: Neil Barkhina

When the first version of Excel Services was released in 2007 with SharePoint Server, customers were excited and eager at the possibilities this would bring. From a BI Perspective, this meant people could finally bring the rich charting and visualization capabilities of Excel to the web. However, in my many years of working with this technology, Excel Services is probably one of the most misunderstood and underutilized features of SharePoint 2007. I believe there are several reasons for this.

For one, the interactivity capabilities were minimal at best. You could send filter data to Excel Services in the form of Named Parameters, but few people used this feature (or even knew about it). Excel Services could also connect to SQL Data Sources. If you were to configure the SQL Connection inside the Workbook and only give people “View” permissions to that file, you could display LOB data in Excel without revealing login information or the IP behind the formulas driving the Workbook. I have seen a few examples of customers using this functionality but by and large, short of just adding an Excel Web Access Web Part to a page in order to display a spreadsheet, few people took advantage it. To me, some of the most compelling value adds of this technology was the rich programmability and platform capabilities. Excel Services exposes a vast API from both .NET and Web Services.

Fast forward to 2010, and Microsoft has now built out this fledgling technology into a much richer platform. Everyone knows that with the 2010 release of SharePoint we now have Office Web Apps. With this, you can edit most of your favorite Office formats right in the web browser such as Word, PowerPoint, OneNote and of course Excel (with Excel in particular you could do multi-user authoring right on the web!) But what they’ve also done is enhance the programmability in a huge way with improvements to the web services layer, and the introduction of a new REST API and Javas­­­­cript Object Model.

I won’t be covering the Jacascript OM in this post, but the cool thing about REST is that it’s very easy to use. You can display parts of your workbook and interact with it simply by formatting a URL, which means no programming knowledge required. This is in line with Microsoft’s promise of so called “BI for the Masses”. The data is also real-time, which means you can always have a Live and up to date view of your Workbook Data (even external data). And because it’s real time, you can embed it into things like Word Docs, PowerPoint or even anonline BLOG.

Let’s take a look at a spreadsheet I used to track how many were coming to my Birthday Party last year. What I did was use a sorting and filtering table to track who I believed was coming, and then I’d mark their probability as High, Medium, Low, and Don’t know. Granted, not the most scientific of methods, but you get the picture:

Adventures in Excel Services 2010 Pic1
In order to access the REST API through a browser simply insert “_vti_bin/ExcelRest.aspx” to the site url of where your spreadsheet resides and then add “/Model” to the end of it. Here is what it looks like in my case:

http://intranet.contoso.com/_vti_bin/ExcelRest.aspx/Shared%20Documents/birthday.xlsx/Model/

Doing this in internet explorer will reveal the following UI:

Adventures in Excel Services 2010 Pic2

As you can see, there are API’s for accessing Ranges, Charts, Tables and even PivotTables. The formatting of how these options get returned can also be specified; in the case of Charts you get an Image back. With Tables or Ranges you can specify an ATOM feed, or even HTML. This makes for some pretty interesting scenarios. With ATOM, you can get access to your workbook data in a structured and programmatic way,and because it’s XML you can subscribe to changes in your workbook and even be alerted subsequently. In the following example, I am requesting just a range A1-C6 from Sheet1 (named ranges are also supported). I can email this link to somebody if I want to highlight just a specific portion of a sheet. This way my colleagues don’t need to dig through an entire spreadsheet just to find what I wanted to show:

http://intranet.contoso.com/_vti_bin/ExcelRest.aspx/Shared%20Documents/birthday.xlsx/Model/Ranges('Sheet1!A1|C6')?$format=HTML

Adventures in Excel Services 2010 Pic3

In the following example I am specifying just the summary area where I calculate how many people are coming based on various probabilities and their current responses. If they told me they ARE coming, I am assuming an 80% chance of showing up, if they said maybe, I give it 50%. Then I calculate the attendance based on Highs and Lows:

http://intranet.contoso.com/_vti_bin/ExcelRest.aspx/Shared%20Documents/birthday.xlsx/Model/Ranges('Sheet1!G10%7CN14')?$format=HTML

Adventures in Excel Services 2010 Pic4

The nice thing about the REST API is you can do “what-if” scenarios by actually changing cell values. The key thing here is that you are not actually saving your changes back to the workbook; it is simply displaying the data in the context of your change. In this example I am changing my Low percentage from 10 to 30. As you can see, at those odds I now need to plan for 6 additional people coming from the Low end:

http://intranet.contoso.com/_vti_bin/ExcelRest.aspx/Shared%20Documents/birthday.xlsx/Model/Ranges('Sheet1!G10%7CN14')?$format=HTML&Ranges('Sheet1!I11')=0.30

Adventures in Excel Services 2010 Pic5

And finally, one of the coolest parts of the API is the ability to return charts as images. You simply pass in the name of the image to the function (if you don’t know the name you can check your workbook, or even browse for it in IE using the REST Model UI by clicking on the Charts Link). The images come back in PNG format, and are always up to date:

http://intranet.contoso.com/_vti_bin/ExcelRest.aspx/Shared%20Documents/birthday.xlsx/Model/Charts('Chart%204')?$format=image

Adventures in Excel Services 2010 Pic6

The interesting thing about this is you can actually embed these images into a Word Document by going to Insert -> Quick Parts -> Field

Adventures in Excel Services 2010 Pic7

In the dialog box, you then pick “IncludePicture” and paste the URL of the Image request using the REST API:

Adventures in Excel Services 2010 Pic8

Now when I go to view my doc in Word or the Web Apps, I have that link to my chart so I can always get the latest version of the data.

Adventures in Excel Services 2010 Pic9

Well I hope this provided a good overview of the power of the REST API and the new capabilities of Excel Services 2010. Check back soon for more to come!

-Neil Barkhina

        

Comments

Simon Rawson

Very nice - thanks. I am going to re-read this a number of times and play around with it.

On another topic, have you had success linking an Excel Services workbook with a SharePoint list? Can it it with a client Excel workbook. This was something a lot of problems were reported about in SP2007, and which I hoped was cured in SP2010.
at 8/9/2010 4:46 AM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Your Name *


e-mail address *


Website (optional)


Comment *


Attachments

 Subscribe

  GigWerks RSS  Gig Werks Mailing List 

 Contact Us

 Connect

 Resources

  On Demand SharePoint Webcast Recordings
  Upcoming Webinars
  SharePoint Resources
  Business Intelligence Resources
  Gig Werks Website



©2009 Gig Werks. All rights reserved. Privacy Policy