Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



LearnNow


XAMALOT
 


SSWUG

Reader rating:
Article source: CoDe (2010 Jul/Aug)


Article Pages:  1  2 - Next >


Excel Services in SharePoint 2010

Excel services is yet another important pillar in Microsoft’s business intelligence offering. Business users really like Excel because it is easy to use and they can add complex formulas to Excel to express their logic. They can do so without involving the IT guy. The problem with this scenario, however, is that it becomes very difficult to share some Excel sheets with their coworkers. Usually users prefer to send workbooks via email, but sometimes the workbooks are too large for email, sometimes they have backend data connections, and sometimes workbooks send via email cause version confusion hell.

Excel Services solves all of these problems. In short, Excel Services allow you to publish an Excel workbook in a document library. The Excel workbook is then calculated on the server, and is then presented to one or more clients. In the calculation, Excel workbooks can involve external data sources or even custom UDFs (user defined functions) written in .NET. Once you publish the Excel workbook (though you could publish just a worksheet or even just an object like a chart), other persons, applications or services with access to the server can consume it directly through the browser by using the Excel WebApplication component, Excel Web Access Web Part, or ExcelService.asmx Web service. The Excel workbook functionality is also available over REST-based APIs and thus can be exposed as Atom feeds or JSON.

Let’s look at a practical example. Start by setting up the Northwind Traders database in a SQL server. You will find the script to set up the Northwind database in the associated code download of this article. Next I’ll craft an Excel workbook that displays orders information from this database as a pivot table and pivot chart.

Start Excel 2010 and click the Data tab in the ribbon, choose "From other sources" and choose to import data from SQL server. You have the ability to import data from various other sources as well. When prompted to import data from SQL server, choose to import the data from the orders table in the Northwind database using Windows authentication. You could have also chosen to use SQL Server authentication or to provide a secure store service ID and get credentials at runtime. Once you have finished importing the data from SQL Server, choose to save the .odc file in a SharePoint "Data Connections Library" that you will need to create beforehand.

At this point, Excel will prompt you to import the data as either a table, a pivot table, or a pivot table and pivot chart. Choose to import the data as a pivot table and pivot chart.

Now in the pivot table, make the following changes:

  1. Make ShipCountry the Report Filter.
  2. Make ShipCity and ShippedDate Row Labels.
  3. Show Sum of Values using the Freight column.

Choose to make USA as the filtered selected country. Your pivot table should look like Figure 1.

Click for a larger version of this image.

Figure 1: My PivotTable.

Note that the pivot chart has been updating itself and is showing you a graphical view of the data you see in the pivot table. Thus the pivot chart and pivot table are connected with each other. I’ll format the chart a bit and will choose to show a line graph instead of a bar chart (Figure 2).

Click for a larger version of this image.

Figure 2: The PivotTable.

Next add a column next to the pivot table and give it a heading of "Difference from Avg.". Give it a formula of "=B4-AVERAGE(B4:B15)" and choose to repeat this formula on all available cells. Also, apply conditional formatting to this cell so it graphically shows you all cities that have freight less than or greater than average. My pivot table now looks like Figure 3.

Click for a larger version of this image.

Figure 3: Databars added within each cell in my pivot table.

Finally, select that A1 cell in the pivot table to make the Options tab in the Ribbon visible. With the Options visible, click on Insert Slicer, and choose to make ShipRegion available in the slicer. This will allow you to slice the data at runtime and subsequently affect the pivot table and pivot chart.

You can see my final Excel sheet in Figure 4.

Click for a larger version of this image.

Figure 4: The final Excel sheet.

Now from the Backstage view of Excel 2010, click Share, and choose to publish this workbook to Excel Services. For now, publish this workbook to a document library called Sheets. You will have to pre-create this document library in your site collection. Also, you will need to pre-activate the enterprise features in your site collection. And if you have used Excel Services with SharePoint 2007, you would remember that at this point you would also have to go into Central Administration and add a trusted file location. In SharePoint 2010 this isn’t necessary because by default, all SharePoint sites are available as trusted file locations. You can verify this by going to the Central Administration | Application Management section, click Manage service applications, and choose to manage the Excel Services service. Click on Trusted file locations, and you should see an entry as shown in Figure 5.

Click for a larger version of this image.

Figure 5: Trusted file locations within SharePoint for Excel Services.

As you can guess, this entry makes the entire SharePoint farm available as a trusted file location.

With the Excel workbook published, drop the Excel Web Access Web Part on the homepage of your SharePoint site collection and configure it to show your newly published Excel workbook. You should see your Excel workbook running with full interactivity in the pivot table, pivot chart, the slicer, and showing live data from the Northwind database. You can see this in Figure 6.

Click for a larger version of this image.

Figure 6: The Excel workbook running in Excel Services 2010.

Now this is a very compelling example. The end business user can craft up such workbooks talking to real data and publish them for the world to see. It gets more interesting than this. For the current web session, these workbooks can be edited in the browser and can recalculate themselves and present new data. Excel Services also have the ability to parameterize certain sheets. Also, the logic of the workbooks is exposed over a Web service and REST API. Let’s look at that next.

&

By: Sahil Malik

Sahil Malik is a Microsoft MVP, INETA speaker, a .NET author, consultant, and trainer, and a well-rounded overweight geek. He has a passion for SharePoint, data access, and application architecture.

Sahil loves interacting with fellow geeks in real time. His talks are full of humor and practical nuggets. His talks tend to get very highly charged, fast moving, and highly interactive.

You should check out his blog at http://blah.winsmarts.com

sahilmalik@gmail.com



Article Pages:  1  2 - Next Page: 'Accessing Excel Services Over REST' >>

Page 1: Excel Services in SharePoint 2010
Page 2: Accessing Excel Services Over REST

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
4.7 out of 5

13 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      AppsWorld Europe

 

SSWUG